zoukankan      html  css  js  c++  java
  • 提交任务photoshop的脚本端

    //访问Photoshop,并把应用程序放置顶层
    #target photoshop
    app.bringToFront();
    //设置场景像素
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;

    if (app.documents.length != 0)
    {
        //放缩图大小 不知道为什么不起作用  BUG?
        app.activeDocument.resizeImage =( 20 , 20  ,72 , ResampleMethod.BICUBICSHARPER) ;

        //获取当前时间,PS获取的月是从0开始的
        var nowTime=new Date();

        //存放缩略图的地址
        jpgFile = new File("c:\\" + app.activeDocument.name)
        //JPG压缩参数
        var jpgSaveOptions = new JPEGSaveOptions();
        jpgSaveOptions.embedColorProfile = true;
        jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
        jpgSaveOptions.matte = MatteType.NONE;
        jpgSaveOptions.quality = 1;
        //另存为
        app.activeDocument.saveAs(jpgFile,jpgSaveOptions,true,Extension.LOWERCASE);

        //写入任务操作
        var strFile =new File( "c:\\test.txt");
        if (strFile.exists)
        {
            strFile.open ("a");
            strFile.writeln(app.activeDocument.name);
            strFile.writeln((nowTime.getMonth() +1).toString() + "月" + nowTime.getDate().toString() + "日");
           strFile.close();
          // alert("任务:"+ app.activeDocument.name + " 提交完成,"+"是否启动AB提交任务?");
           var bool = confirm("任务:"+ app.activeDocument.name + " 提交完成,"+"是否启动AB提交任务?");
           if(bool == true)
           {
               //启动外部程序的方法
                var ww =new File( "C:\\Program Files\\Autodesk\\3ds Max 2011\\3dsmax.exe");
                ww.execute();
            }
           else
           {
               alert("再见");
            }
        }
    }

  • 相关阅读:
    吴裕雄 python深度学习与实践(1)
    吴裕雄 python 机器学习-Logistic(1)
    吴裕雄 python 熵权法确定特征权重
    【Uva 1252】Twenty Questions
    【玲珑杯 round#18 B】图论你先敲完模板
    【Uva 10817】Headmaster's Headache
    【玲珑杯 round#18 A】计算几何你瞎暴力
    【Uva 12128】Perfect Service
    【UVa 12186】Another Crisis
    【Uva 10003】Cutting Sticks
  • 原文地址:https://www.cnblogs.com/softimagewht/p/2265081.html
Copyright © 2011-2022 走看看