【发布时间】:2018-03-02 12:14:29
【问题描述】:
我正在尝试为 Keyboard Maestro 宏编写 AppleScript,它会在现有的 Finder 窗口中打开相机 SD 或 CF 卡的图片文件夹。 这是我当前的代码,用于打开已安装的卷。
tell application "Keyboard Maestro Engine"
set KMVarPath to get value of variable "path"
end tell
set the_string to "/Volumes/" & KMVarPath
set the_path to (POSIX file the_string) as string
tell application "Finder"
activate
if window 1 exists then
set target of window 1 to the_path
else
reveal the_path
end if
end tell
问题是这些文件夹被称为 276ND2XS 或 105ND800。我想指定“后缀”(ND2XS/ND800)并打开“前缀”编号最高的文件夹。
有没有办法做到这一点?
为了方便起见,有没有办法检查卷是 SD 卡还是 CF 卡?还是我必须通过名称检查(NIKON D2XS / NIKON D800)?
【问题讨论】:
标签: automation applescript keyboard-maestro