Skip to content

An ExtendScript utility to help transform your code to batchPlay

Notifications You must be signed in to change notification settings

adobe-uxp/ps-es-to-uxp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ExtendScript BatchPlay logger

This code, when used in an ExtendScript project, and calls replaced by the given methods, will print out all executeAction and executeActionGet methods in batchPlay format.

Usage

Call the ad-to-uxp.jsx file using $.evalFile method in ExtendScript:

var mainScriptPath = Folder($.fileName).parent.parent ; 
$.evalFile(new File(mainScriptPath + '/ad-to-uxp.jsx'));

And replace all the calls to executeAction and executeActionGet with executeActionForUXP and executeActionGetForUXP. Mind the string matching for executeActionGets so you don't end up with executeActionForUXPGetForUXP.

Now, when you run an extendscript like this:

var ref = new ActionReference();
ref.putProperty(charIDToTypeID('Prpr'), charIDToTypeID("Nm  "));
ref.putIndex(charIDToTypeID('Lyr '), 1);
executeActionGetForUXP(ref);    

You will get a print out like this, and your script will continue to function.

require('photoshop').action.batchPlay([{ "_obj": "get", "_target":{ "_ref": [{ "_property": "name" }, { "_ref": "layer", "_index": 1 }]} }], {})

About

An ExtendScript utility to help transform your code to batchPlay

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published