【发布时间】:2018-11-11 15:58:33
【问题描述】:
我一直在尝试使用我所拥有的知识编写一个 Applescript
目前的绊脚石是
-获取返回的列表选择以运行 Photoshop 操作
-如何在多个图像上重复操作。
瞄准 我想使用一个列表从定义的文件夹中提取不同的文件组合(具有设置的命名约定), 然后,我希望相同的列表选择在多个 photoshop 操作之间进行选择,并通过该操作运行提取的文件组合。
第一阶段 -在运行时打开一个列表
-包含一组与 Photoshop 操作相关的名称的列表
-从列表中选择
第 2 阶段 - 选择包含源图像的文件夹(总是 14 个图像,最后 9 个字符总是相同的 _0000.tif 到 _0013.tif)
-选择一个保存文件夹
第 3 阶段 - 依赖于原始列表选择,自动从源图像文件夹中收集文件并通过相应的 photoshop 操作运行它们
例如,如果从列表中选择“动作 1”,则从源文件夹中选择图像“_0001.tiff & _0010.tif”并执行 Photoshop 动作“Action1”
第四阶段 保存在选定的“保存文件夹”中
到目前为止的脚本
--第一阶段--
set PhotoshopActionList to {"Action1", "Action2", "Action3", "Action4", "Action5"}
set ActionrequiredAnswer to choose from list PhotoshopActionList with title "Actions Picker" with prompt "Choose Action?"
if ActionrequiredAnswer is false then
error number -128 (* user cancelled *)
else
set ActionrequiredAnswer to ActionrequiredAnswer's item 1 (* extract choice from list*)
end if
end run
--第二阶段--
property SourceFolder : missing value
property destinationFolder : missing value
if SourceFolder = missing value then
set SourceFolder to (choose folder with prompt "Choose Base Images:")
set destinationFolder to (choose folder with prompt "Choose Save Location:")
else
tell application "Finder"
set theFolders to every item of entire contents of SourceFolder as list
repeat with thisFolder in theFolders
make new alias file at destinationFolder to thisFolder
end repeat
end tell
end if
--第三阶段--
tell application "Finder"
set filesList to {files of entire contents of SourceFolder contains "_001", "_002", "003"} as alias list
end tell
tell application "Adobe Photoshop"
repeat with aFile in filesList
open aFile
do action "Action1" from "Actionsfolder"
end tell
--第四阶段--
save currentDocument in folder destinationFolder as JPEG
【问题讨论】:
-
“我正在努力将所有核心领域拉到一起” - 请edit your question 澄清一下绊脚石到底在哪里?
-
感谢您的回复,更新了,应该更清楚我现在在挣扎什么,
标签: list applescript action photoshop tiff