开发者

Opening Files in Photoshop with Applescript

I am trying to use Applescript to automate a task in photoshop.

When attempting to open a file:

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 tim开发者_如何学编程eout

end tell

The result is an error:

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

What am I doing wrong?

-J


An alias path includes the HD name in the root. So you need to change your one line to this

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜