3 Replies Latest reply on Sep 16, 2017 4:09 PM by Ten A

    resize and rotate selection

    lewiscc Level 1

      I would like to resize and rotate a selection object, but the object have opacity mask.

      selection[0].resize () and selection[0].rotate() can not change opacity mask. can someone help me.

        • 1. Re: resize and rotate selection
          Ten A Adobe Community Professional

          Here is an experimental code and its worked.

           

          app.activeDocument.layers.getByName("<不透明マスク>").pathItems[0].rotate(90);
          

           

          Please note that my environment is Japanese locale and I don't know opacity mask layers name in En.

          Probably, It might be "<Opacity Mask>".

          • 2. Re: resize and rotate selection
            moluapple Level 4

            I think he is Chinese, so the name will be "<不透明蒙版>". But as I tested you code only work when you enter the "edit opacity mask" mode, right?

             

            To lewiscc:

            你问了很多不透明蒙版相关的问题,归根结底在于对于脚本来说它是个幻影般的存在,脚本识别不到它(可以归为bug或至少是缺陷)。解决的方法无非还是我提到的那些:

            1. 脚本内嵌动作,动作中录制旋转/缩放等操作。

            2. 扭曲与变换效果,跟你已经实现的移动操作一样。

            3. 将整个对象建立为符号。其实我觉得这个更方便,尤其是当你要复制很多份的时候,可以显著减小文件大小。

            • 3. Re: resize and rotate selection
              Ten A Adobe Community Professional

              Hi moluapple,

              You are correct. I took misstake to forget in the mask mode when latest code.