У меня есть следующий код:
on open theDroppedItems
set PosixList to {}
repeat with a from 1 to length of theDroppedItems
set theCurrentDroppedItem to item a of theDroppedItems
set PosixPath to convertPathToPOSIXString(theCurrentDroppedItem)
copy PosixPath to the end of the PosixList
end repeat
display dialog convertListToString(PosixList, space)
end open
on convertPathToPOSIXString(thePath)
tell application "System Events"
try
set thePath to path of disk item (thePath as string)
on error
set thePath to path of thePath
end try
end tell
return POSIX path of thePath
end convertPathToPOSIXString
on convertListToString(theList, theDelimiter)
set AppleScript's text item delimiters to theDelimiter
set theString to theList as string
set AppleScript's text item delimiters to ""
return theString
end convertListToString
Я ожидаю, что он позволит мне перетащить файл на appleScript (сохраненный как приложение) и отобразить список, похожий на /Users/adam/a.txt /users/adam/b.txt
, однако он даетМне 2 диалогов, 1 с путем к первому файлу, затем второй с путем ко второму файлу.Чего мне не хватает?
спасибо!