尝试使用applescript在特定位置创建文件夹时出错

时间:2017-09-13 04:28:07

标签: applescript

代码

tell application "Finder"
    make new folder at "iCloud Drive: Documents" with properties {name:"my Folder"}
end tell

错误消息

  

错误" Finder收到错误:AppleEvent处理程序失败。"数字-10000

系统概述

Macbook Pro:MacOS Sierra 10.12.6

1 个答案:

答案 0 :(得分:0)

iCloud Drive不是物理磁盘。只需使用标准documents folder

即可
set documentsFolder to path to documents folder
tell application "Finder"
    make new folder at documentsFolder with properties {name:"my Folder"}
end tell