Operating system 使用applescript打开文件夹(带空格的文件路径)

Operating system 使用applescript打开文件夹(带空格的文件路径),operating-system,applescript,directory,filepath,Operating System,Applescript,Directory,Filepath,我想我的问题是文件路径中的空格。但我不能让它工作 下面是我要打开的文件夹路径:/Users/username/Library/Speech/Speakable Items假设您的路径正确,它将是: tell application "Finder" open ("/Users/username/Library/Speech/Speakable Items" as POSIX file) end tell 我得到了错误:error“Finder得到了一个错误:AppleEvent处理程序

我想我的问题是文件路径中的空格。但我不能让它工作


下面是我要打开的文件夹路径:
/Users/username/Library/Speech/Speakable Items

假设您的路径正确,它将是:

tell application "Finder"
    open ("/Users/username/Library/Speech/Speakable Items" as POSIX file)
end tell

我得到了错误:error“Finder得到了一个错误:AppleEvent处理程序失败。”number-10000文件路径应该是正确的,因为我直接将它从Finder拖到AppleScript中,它与我认为应该的匹配。OK-首先用一个更简单的路径尝试,例如,
告诉应用程序“Finder”打开(“/Users/username/Documents”作为POSIX文件)end tell
-这对我来说没问题-我无法尝试
可说出的项目
,因为我似乎没有该文件夹。我确实尝试了一条带有空格的路径,但似乎也可以。Duh!!!!忘了把“用户名”改回我的名字!我真蠢!非常感谢!啊哈-好主意-我很困惑为什么它对你不起作用!