Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Snap with scripting

$
0
0

Sorry, I should have caught that you were using charIDToTypeID. It's a good bet if the string starts with a lowercase letter it is a stringID even if it is 4 chars.

 

I assume that the last code you posted works with CS2. If so you could change that runMenuItem to something like this so it will work with both char and string IDs.

 

function runMenuItem(item)
{
   cTID = function(s)
   {
      return app.charIDToTypeID(s);
   }
   var desc = new ActionDescriptor();
   var ref = new ActionReference();
   ref.putEnumerated( cTID( "Mn  " ), cTID( "MnIt" ), item  );
   desc.putReference( cTID( "null" ), ref );
   executeAction( cTID( "slct" ), desc, DialogModes.NO );
}

runMenuItem(stringIDToTypeID("snap"));


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>