脚本新手:错误" Finder出错:无法获取文件夹

时间:2017-07-25 21:25:08

标签: compiler-errors applescript

教科书中的一个练习令我难过,示例脚本:

tell application "Finder"

    tell folder "AppleScript" of folder "Applications"
        set file_list to name of every item
        set time_folder_was_created to creation date
        set time_folder_was_modified to modification date

    end tell
end tell

脚本编辑器一直给我这个结果:错误" Finder收到错误:无法获取文件夹\" Applications \"。"从文件夹"应用程序"

编号-1728

这是否与过时的进程或应用程序文件夹的OS 10.11安全性有关,或者我没有看到它。

1 个答案:

答案 0 :(得分:0)

文件夹$(CXXFLAGS)Applications

的子文件夹
startup disk

或使用相对路径

tell application "Finder"
    tell folder "AppleScript" of folder "Applications" of startup disk
        set file_list to name of every item
        set time_folder_was_created to creation date
        set time_folder_was_modified to modification date
    end tell
end tell