我正在尝试为键盘大师宏编写 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)进行检查?