使用Applescript在Photoshop中打开文件

时间:2011-01-19 17:45:39

标签: automation applescript photoshop

我正在尝试使用Applescript在photoshop中自动执行任务。

尝试打开文件时:

tell application "Adobe Photoshop CS5"

 -- Open the first image
 set filePath to alias "Users:jameshale:Pictures:DSC_1273.jpg"
 with timeout of 5 seconds
  open filePath as Camera RAW
 end timeout

end tell

结果是错误:

error "Adobe Photoshop CS5 got an error: Can’t get alias \"Users:jameshale:Pictures:DSC_1273.jpg\"." number -1728

我做错了什么?

-J

1 个答案:

答案 0 :(得分:0)

别名路径包括根目录中的HD名称。所以你需要将你的一行改为

// Replace Macintosh HD with your HD name 
set filePath to alias "Macintosh HD:Users:jameshale:Pictures:DSC_1273.jpg"