Note that there are some explanatory texts on larger screens.

plurals
  1. POScripting the creation of an Action in Photoshop
    text
    copied!<p>I've written a file exporter in javascript for Photoshop which displays a dialog and allows the user to select some options then exports to multiple files. I'd like to provide a button in the dialog which creates an Action, and assigns a Function key shortcut to run the script afterwards by hitting the Function key.</p> <p>Usually, the user would create the Action manually, but most of my users aren't familiar with Actions and I'd like to make the workflow as simple as possible.</p> <p>So. I've used the ScriptingListener.plugin to grab the actions that are played when I manually create the Action (from the actions panel; create an action, name it, choose a function key, hit 'record', browse to my script, run it, end recording) and this is what it records;</p> <pre><code>var id1 = stringIDToTypeID( "AdobeScriptAutomation Scripts" ); var desc1 = new ActionDescriptor(); var id2 = charIDToTypeID( "jsCt" ); desc1.putPath( id2, new File( "/Users/stewart/Projects/Export.jsx" ) ); var id3 = charIDToTypeID( "jsMs" ); desc1.putString( id3, "undefined" ); executeAction( id1, desc1, DialogModes.YES ); </code></pre> <p>This appears to be just the code to run the script, but not the code to create the action.</p> <p>My assumption at this point is that because the ScriptingListener doesn't capture these interactions, scripting this won't be possible.</p> <p>I'm working with Photoshop CS3 or later.</p> <p>Is it possible to write a script which creates an Action that will run the script (effectively installing an Action for itself)?</p> <p>Further, can the script also assign a shortcut key for the created Action?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload