0
Этот код для апплета создает определенную структуру папок внутри одной выбранной папки или независимо от того, какая открытая папка находится в Finder при щелчке апплета. Он разбивается, если выбрано несколько папок. Есть ли способ заставить этот скрипт работать при выборе нескольких папок?Applescript: создать новую структуру папок в нескольких папках
property archivesFolder : "Archives"
property imagesFolder : "Images"
property proofreadFolder : "Proofreading"
property proofFolder : "Proofs"
property sourceFolder : "Source"
try
tell application "Finder" to set theLocation to the selection as alias
on error
tell application "Finder" to set theLocation to (folder of the front window as alias)
end try
tell application "Finder"
if not (exists folder archivesFolder of theLocation) then
make new folder at theLocation with properties {name:archivesFolder}
end if
if not (exists folder imagesFolder of theLocation) then
make new folder at theLocation with properties {name:imagesFolder}
end if
if not (exists folder proofreadFolder of theLocation) then
make new folder at theLocation with properties {name:proofreadFolder}
end if
if not (exists folder proofFolder of theLocation) then
make new folder at theLocation with properties {name:proofFolder}
end if
if not (exists folder sourceFolder of theLocation) then
make new folder at theLocation with properties {name:sourceFolder}
end if
end tell
Работает отлично, но теряет функциональность создания этих папок в текущем окне Finder, если ничего не выбрано. – user1231499
@ user1231499 Здесь вы найдете: https://gist.github.com/1932089 – fanaugen
@fanaugen Не ответил ли опубликованный ответ? Можете ли вы помочь мне повторить ошибку? – adayzdone