zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    【设计模式
    【设计模式
    【设计模式
    【设计模式
    【设计模式
    【设计模式
    实干猪
    Mysql 千万级快速查询|分页方案
    如何成为一名优秀的CTO(首席技术官)
    成为优秀程序员的10个有效方法
  • 原文地址:https://www.cnblogs.com/huangshiyu13/p/6283439.html
Copyright © 2011-2022 走看看