好的,我有一个修补程序,并提出了一个半AppleScript 半ShellScript,它在上面进行了扩展。我欢迎任何意见:)
这通过提示输入部分文件名(用空格分隔),找到最顶层的 Finder 窗口以获取当前文件夹位置(要搜索的根文件夹),使用 Shell 将星号添加到搜索查询(部分文件名而不是完整),从我们已经在 Finder 中打开的“根”文件夹执行查找命令。找到的文件在 Photoshop 中打开。
tell application "Finder"
try
activate
beep 1
display dialog "Enter your image search:" default answer ""
set dialogInfo to result
set imgquery to text returned of dialogInfo
set frontWin to folder of front window as string
set frontWinPath to (get POSIX path of frontWin)
tell application "Terminal"
activate
set starredImgQuery to do shell script "echo " & quoted form of imgquery & " | sed 's/ /\\* */g'"
set starredImgQuery to "*" & starredImgQuery & "*"
do shell script "cd \"" & frontWinPath & "\";for f in " & starredImgQuery & "; do find . -name \"$f\" -exec open -a \"/Applications/Adobe Photoshop CS4/Adobe Photoshop CS4.app\" {} \\;; done"
end tell
tell application "Terminal" to quit
on error error_message
beep
display dialog error_message buttons ¬
{"OK"} default button 1
end try
end tell
shell命令很棒!