2

在要求用户选择文件夹的自动化脚本之后,我有这个applescript-

on run {input, parameters}
try
    set theFolder to input
    tell application "Finder" to set name of theFolder to "test"

on error e number n
    set theLine to (do shell script "date  +'%Y-%m-%d %H:%M:%S'" as string) & " " & "OOPs: " & e & " " & n
    do shell script "echo " & theLine & " >> ~/Library/Logs/AudioModdeer-events.log"
end try

return input
end run

我的日志给了我以下错误-

2013-09-03 16:50:56 OOP:AppleEvent 处理程序失败。-10000

2013-09-03 16:51:28 OOP:无法设置 {alias Macintosh HD:Users:Audio:Music:Ableton:User Library:Samples:Samples:} 的名称进行测试。-10006

4

2 回答 2

2

您必须从输入列表中引用一项...

set theFolder to first item of input
于 2013-09-03T11:19:55.340 回答
0

我几乎是 AppleScript 的新手,但我今天发现以下方法也有效:

move contents of <oldFolder> to make new folder at alias <currentLocation> with properties {name:"<newName>"}

希望这也对你有用。

于 2013-12-03T12:43:42.100 回答