It does have a record feature of sorts, but it involves quiting Photoshop, moving a plugin into the plugins folder, relaunch Photoshop, do your thing, then quit Photoshop, unload the plugin.
The plugin is a “watcher” called “ScriptingListener.plugin” that runs the entire time it is loaded and dumps JavaScript to a file on your desktop. This JavaScript can be run via an AppleScript or embedded into a self-running script (like with FaceSpan).
For example, this dump from the ScriptListener opens a file and simply re-saves it in order to rebuild the little thumbnail icon in the Finder:
// =======================================================
var id20 = charIDToTypeID( "Mk " );
var desc3 = new ActionDescriptor();
var id21 = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var id22 = charIDToTypeID( "Lyr " );
ref1.putClass( id22 );
desc3.putReference( id21, ref1 );
var id23 = charIDToTypeID( "Usng" );
var desc4 = new ActionDescriptor();
var id24 = charIDToTypeID( "Nm " );
desc4.putString( id24, "SCRIPT_TEMP" );
var id25 = charIDToTypeID( "Lyr " );
desc3.putObject( id23, id25, desc4 );
executeAction( id20, desc3, DialogModes.NO );
// =======================================================
var id26 = charIDToTypeID( "Dlt " );
var desc5 = new ActionDescriptor();
var id27 = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var id28 = charIDToTypeID( "Lyr " );
var id29 = charIDToTypeID( "Ordn" );
var id30 = charIDToTypeID( "Trgt" );
ref2.putEnumerated( id28, id29, id30 );
desc5.putReference( id27, ref2 );
executeAction( id26, desc5, DialogModes.NO );
// =======================================================
var id31 = charIDToTypeID( "save" );
executeAction( id31, undefined, DialogModes.NO );
// =======================================================
var id32 = charIDToTypeID( "Cls " );
executeAction( id32, undefined, DialogModes.NO );
Actually when I did the initial capture I had to weed out some code I didn’t need because it captures literally everything you do, which was a tad overkill.
The code to execute this from AppleScript was:
tell application "Adobe Photoshop CS2"
open (path_to_fix as alias)
--execute JavaScript control of Photoshop
--acquired with ScriptingListener plugin per Adobe guidelines
do javascript (script_location as alias)
end tell
I.E. open a given file, use script on it…script includes the close of the file. I tried the “do javascript” with the entire script embedded in a string in AppleScript but it kept choking on the quotes used throughout (even when changed to single quotes) so in the end I had to keep the Javascript external to the AppleScript. Knowing what I know now, I wonder if fiddling with delimiters would allow the JavaScript to be inside the AppleScript?
Hope this helps…