Skip to main content
caughtnapping
Participant
May 2, 2015
Answered

How do I find the menuID for the Photoshop Transform menu

  • May 2, 2015
  • 2 replies
  • 2417 views

I am new to using ExtendScript and want to create a script that starts by selecting Transform >> Skew. The JavaScript script reference mentions the method 'runMenuItem' but I don't know how to find the menuID to use it.

This topic has been closed for replies.
Correct answer I have gone

You create an action to select it using insert menuitem, then look at the scriptlistner output, from this you can use.

try{

app.runMenuItem(charIDToTypeID('Skew'));

}catch(e){};

2 replies

JJMack
Community Expert
Community Expert
May 2, 2015

cTID = function(s) { return app.charIDToTypeID(s); };

sTID = function(s) { return app.stringIDToTypeID(s); };

//==================== Interactive Transform ==============

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);

};

Photoshop Javascript guide Appendix A: Event ID Codes has  all the cods like FrTr  for transform

use Scriptlistener Plugin to record Action manager code.  Create functions the uset the functions.

try{

  InteractiveTransform()

  }catch(e){alert("Image Transform Canceled");}

JJMack
I have goneCorrect answer
Inspiring
May 2, 2015

You create an action to select it using insert menuitem, then look at the scriptlistner output, from this you can use.

try{

app.runMenuItem(charIDToTypeID('Skew'));

}catch(e){};

caughtnapping
Participant
May 3, 2015

Thanks for that....now if only I could get ScriptListener to work with Photoshop CC 2014. Not sure it's compatible yet as it doesn't show under Extensions after being placed in the Plugins folder and rebooting. Any suggestions?

Inspiring
May 3, 2015

Sorry can't help as I only have CS6.