Вопрос

after an automator script that asks a user to choose a folder i have this 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

my log gives me the following error-

2013-09-03 16:50:56 OOPs: AppleEvent handler failed. -10000

2013-09-03 16:51:28 OOPs: Can’t set name of {alias Macintosh HD:Users:Audio:Music:Ableton:User Library:Samples:Samples:} to test. -10006

Это было полезно?

Решение

You have to reference one item from the Input list...

set theFolder to first item of input

Другие советы

I'm pretty much a newbie to AppleScript, but I found out today that the following works, too:

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

Hope this works for you, too.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top