Photoshop脚本之调试

系统:mac

创建test.scpt和test.jsx

command+空格,打开 脚本编辑器(applescript)

脚本编辑器打开test.scpt

输入:

tell application "Adobe Photoshop CC 2015"
    -- 'do javascript' runs any arbitrary JS.
    -- We're using the #include feature to run another
    -- file. (That's an Adobe extension to JS.)
    --
    -- You have to pass a full, absolute path to #include.
    --
    -- The documentation alleges that 'do javascript'
    -- can be passed an AppleScript file object, but
    -- I wasn't able to get that to work.
    do javascript "#include ~/test.jsx"
end tell

在test.jsx中输入:

function print(mess){
    alert(mess)
}

print('test')

然后在脚本编辑器里点击三角形的运行按钮:

即可看到输出结果!

 

也可以在命令行运行:osascript test.scpt 

 

自己创建的test.scpt文件可能在保存的时候报错,所以可以先打开applescript, 新建文件,然后保存成test.scpt

参考链接:http://stackoverflow.com/questions/3846626/is-it-possible-to-execute-jsx-scripts-from-outside-extendscript

转载于:https://www.cnblogs.com/huangshiyu13/p/6283439.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值