Я только что открыл для себя Applescript и начал использовать его потенциал. Я искал решение для этого в течение 2 дней, но ничего не помогло! .. Вот капля applescript, которая обрабатывает размещенные файлы jpg в папке с помощью программы, а затем перемещает полученные файлы в новую подпапку. Я новичок в программировании, и мои навыки очень ограничены. Я пытался добавить суффикс к окончательному обработанному файлу, но никак не мог! Это код.
on adding folder items to this_folder after receiving these_items
set project to (this_folder as text) & "processor.imprc" -- This is the name of the file that calls the external application
set done_folder to "Done"
tell application "Finder"
if not (exists folder done_folder of this_folder) then
make new folder at this_folder with properties {name:done_folder}
end if
set the destination_folder to folder done_folder of this_folder as alias
set the destination_directory to POSIX path of the destination_folder
end tell
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to info for this_item
if this_item is not the destination_folder and the name extension of the item_info is "jpg" then
set the item_path to the POSIX path of this_item
set the destination_path to the destination_directory & (name of the item_info) -- Here is where I think it defines the name of the "produced" file
tell application "Image Process" -- From this point on commands for the external application start
activate
open project
tell first document
set source to item_path
impose in destination_path
close saving no
end tell
end tell
end if
end repeat
end adding folder items to
Буду очень признателен за любую помощь в добавлении суффикса (например, «_edited») к каждому обработанному файлу (в папке «Готово»)
Заранее спасибо!
Джош