Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scripting Transform for user interaction

Community Expert ,
Feb 07, 2013 Feb 07, 2013

I'm trying to create a vector layer in PS CS6 that is used as a cropping guide for portraits.  When I try to apply a transform to this layer, the transform box comes up but I can't change anything.  I've done a search for this, and seen some examples from Mike and Paul, but they all will not allow me to change the transform.

TOPICS
Actions and scripting
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Valorous Hero ,
Feb 07, 2013 Feb 07, 2013

If you are calling the  transform from within an UI it will not allow  you to change anything. It must be called from inline code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2013 Feb 07, 2013

No, Paul, the UI was closed, and it was called after creating the vector layer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 07, 2013 Feb 07, 2013

.. it was called after creating the vector layer.

Is the vector mask active/selected? If so it transforming the path instead of the layer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2013 Feb 07, 2013

I put an esc command to deselect the path and hopefully do the layer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2013 Feb 08, 2013
LATEST

You may want to make sure what the Photoshop target is when you do the transform and also make sure there is no active selection.  Like perhaps set the which layer is the active active layer and target the RGB channel. Free Transform may have some options disabled depending on layer type.  For example if the current targeted layer is a text layer distort and perspective transforms can not be done. You would need to convert the text layer to a shape layer first to do that type of transform. You may want to also have a try catch to allow cancel for if no change is made ENTER as well as ESC cancels the transform.

activeDocument.selection.deselect();

try{

InteractiveTransform()

}catch(e){alert("Image Transform Canceled");}  //  or have no message

function InteractiveTransform() {

  // Menu Edit>Free transform

    var desc1 = new ActionDescriptor();

    var ref1 = new ActionReference();

    ref1.putEnumerated(cTID('Mn  '), cTID('MnIt'), cTID('FrTr'));

    desc1.putReference(cTID('null'), ref1);

    executeAction(cTID('slct'), desc1, DialogModes.NO);

};

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines