【发布时间】:2017-08-31 11:17:01
【问题描述】:
我有这个作为图像查找服务添加的 Automator。
这一切都始于用户选择一堆图像并在服务菜单上选择脚本。
然后脚本首先问用户两个问题:
on run {input, parameters}
choose from list {"iPhone", "iPad", "Mac"} with prompt "Choose Platform"
set platform to the result as string
display dialog "Choose File Name" default answer ""
set fileName to the result as string
// here it goes the magic line
return input
end run
当场“这就是神奇的线”我想添加一条线,将platform 和fileName 添加为将传递给shell 的参数(输入?)数组(?)上的两个条目将遵循此 AppleScript 的脚本。
shell 脚本将包含以下几行:
platform=$1
shift
fileName=$1
shift
for f in "$@"; do
// files will be processed here
我不确定 shell 脚本将如何接收它,但据我所知,它应该接收类似数组的东西,由 3 项组成:平台、文件名和所选文件列表。我了解 shift 将删除输入开头的项目。
出于这个原因,我尝试了以下几行:
set beginning of input to platform as string and fileName as string
还有
set beginning of input to platform
set beginning of input to fileName
//hoping it will push platform to the second position
但没有任何效果。
任何想法
【问题讨论】:
标签: applescript automator