Applescript-如何解决文件夹路径中的空白?

我在使用包含空格的文件夹路径执行AppleScript时遇到麻烦。我该如何解决这个问题?预先谢谢你。

tell application "Finder"
    set myWin to window 1
    set thePath to (quoted form of POSIX path of (target of myWin as alias))
    tell application "Terminal"
        activate
        tell window 1
            do script "/Users/johndoe/Company Dropbox/John Doe/Folder " & thePath
        end tell
    end tell
end tell
wb1317 回答:Applescript-如何解决文件夹路径中的空白?

@red_menace解决方案有效;但是我找到了另一个选择。您可以添加\\来解决文件夹路径中的空白。

示例:

"/Users/johndoe/Company\\ Dropbox/John\\ Doe/Folder"
                       ^^             ^^
本文链接:https://www.f2er.com/3158357.html

大家都在问