使用AppleScript将注释设置为文件/文件夹

时间:2014-07-03 10:38:55

标签: macos applescript

我在这里遗漏了一些文件/文件夹的注释。

请帮我弄清楚丢失的东西:

tell application "Finder"

    set filePath to "Macintosh HD:Users:anoopvaidya:Desktop:2.png"
    if exists file filePath then
        --display alert "file:" & filePath
        set comment of filePath to "hi boy"
    end if

end tell

它会抛出以下错误:

1 个答案:

答案 0 :(得分:2)

set comment of (filePath as alias) to "hi boy"