Export action as script

  • 1
  • Idea
  • Updated 8 months ago
It would be very usefull if actions could be exported as scripts (Javascript / Applescript). Replaying a recording from the ScriptingListener doesn't always work.
Photo of tmmls

tmmls

  • 21 Posts
  • 1 Reply Like

Posted 8 months ago

  • 1
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 763 Posts
  • 150 Reply Likes
Script listener code should contain same data as Action. But in different format. Anyway if scriptListener code is broken or unplayable then it is same for action.
Photo of tmmls

tmmls

  • 21 Posts
  • 1 Reply Like
Dear Mr./Ms. Bereza. I did multiple tests. Trying to edit the content of a smart object will work using an action, but not when using Extendscript Toolkit executing a scripting listener recording. An error is thrown that the feature is not supported. Doing small stuff like converting an rgb image to cmyk does work.

(Edited)
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1199 Posts
  • 159 Reply Likes
How did you create that code? 

Opening an embedded Smart tObject works fine for me: 

var id1025 = charIDToTypeID( "slct" );
var desc193 = new ActionDescriptor();
var id1026 = charIDToTypeID( "null" );
var ref152 = new ActionReference();
var id1027 = charIDToTypeID( "Mn  " );
var id1028 = charIDToTypeID( "MnIt" );
var id1029 = stringIDToTypeID( "placedLayerEditContents" );
ref152.putEnumerated( id1027, id1028, id1029 );
desc193.putReference( id1026, ref152 );
executeAction( id1025, desc193, DialogModes.NO );
Photo of tmmls

tmmls

  • 21 Posts
  • 1 Reply Like
Hi Christoph, Your code works fine. How did you create it ? I used the scriptlistener plugin.
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1199 Posts
  • 159 Reply Likes
Actually I am not sure anymore whether I recorded it myself or extracted it from one of xbytor’s libraries. 

Did you record the operation directly or the Action? 
Photo of tmmls

tmmls

  • 21 Posts
  • 1 Reply Like
I recorded it directly
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 763 Posts
  • 150 Reply Likes
Some actions (with modal states) creates multiple steps and only one from these steps is the thing you are looking for.
Btw I am male ;-)