我刚刚发现了 Applescript 并开始使用它的潜力。我已经为此研究了 2 天的解决方案,但没有任何效果!.. 这是一个 applescript droplet,它通过程序处理文件夹中存放的 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”)添加到每个处理的文件(在“完成”文件夹中)
提前致谢!
乔什