Applescript编辑器无法查找文件

Applescript编辑器无法查找文件,applescript,Applescript,我需要编写一些代码来实现这一点,但Applescript编辑器无法查看文件ewqe_是否存在。它是存在的 路径应以以下格式写入: "Macintosh HD:Users:username:Desktop:file.txt" 试着这样做: set fullPath to (POSIX path of (path to desktop folder as text)) & "aFolderOnMyDesktop/44034_D.pdf" tell application "System E

我需要编写一些代码来实现这一点,但Applescript编辑器无法查看文件ewqe_是否存在。它是存在的


路径应以以下格式写入:

"Macintosh HD:Users:username:Desktop:file.txt"
试着这样做:

set fullPath to (POSIX path of (path to desktop folder as text)) & "aFolderOnMyDesktop/44034_D.pdf"
tell application "System Events"
    if exists file fullPath then
        log fullPath
        -- do your stuff
    end if
end tell
从StandardAdditions到命令的路径:

path to v : Return the full path to the specified folder
path to application support/applications folder/desktop/desktop pictures folder/documents folder/downloads folder/favorites folder/Folder Action scripts/fonts/help/home folder/internet plugins/keychain folder/library folder/modem scripts/movies folder/music folder/pictures folder/preferences/printer descriptions/public folder/scripting additions folder/scripts folder/services folder/shared documents/shared libraries/sites folder/startup disk/startup items/system folder/system preferences/temporary items/trash/users folder/utilities folder/workflows folder/voices/apple menu/control panels/control strip modules/extensions/launcher items folder/printer drivers/printmonitor/shutdown folder/speakable items/stationery : the folder to return
[from system domain/local domain/network domain/user domain/Classic domain] : where to look for the indicated folder
[as type class] : the type to return: alias or string (default is alias)
[folder creation boolean] : Create the folder if it doesn’t exist? (default is true)
→ alias : the path to the specified folder

谢谢你的回答。我更新了我的帖子。看一看不要将POSIX路径与“exists file”一起使用,只使用“:”格式它是POSIX路径!只需使用您首先用于在桌面之后添加部件的样式,如应用程序支持/Hash-Remover/。。。这就是Posix样式,它起作用了。谢谢还有一件事:如果它位于~/Library/Application-support/hash-remover/…,该怎么办?您可以使用path to application support文件夹作为文本或path to命令所理解的任何规范。