在一个automator脚本之后,要求用户选择我有这个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 OOPs:AppleEvent处理程序失败。 -10000
2013-09-03 16:51:28 OOPs:无法设置{alias Macintosh HD:用户:音频:音乐:Ableton:用户库:样本:样本:}的名称进行测试。 -10006
答案 0 :(得分:2)
您必须从输入列表中引用一个项目...
set theFolder to first item of input
答案 1 :(得分:0)
我几乎是AppleScript的新手,但我今天发现以下内容也是如此:
move contents of <oldFolder> to make new folder at alias <currentLocation> with properties {name:"<newName>"}
希望这也适合你。