I am working on a script that will create actions for me. Script listener recorded nothing, so I made an action that created another action, then ran it through xbytors ActionToJavascript to get the code. This code creates a new action, starts recording. It records a new item every second or so that says Script, but has no script in it. Its pretty strange. Anyone have any idea what is going on, or how I could stop it? It doesnt need to stop recording, but if that fixes it, that would be great.
Code: Select allmakeAction("Action 8", "An Action Set");
function makeAction(actionName, existingActionSet){
// var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(cTID('Actn'));
desc1.putReference(cTID('null'), ref1);
var ref2 = new ActionReference();
ref2.putName(cTID('ASet'), existingActionSet);
desc1.putReference(cTID('At '), ref2);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), actionName);
desc2.putInteger(cTID('FncK'), 0);
desc1.putObject(cTID('Usng'), cTID('Actn'), desc2);
executeAction(cTID('Mk '), desc1, DialogModes.NO);
app.runMenuItem(cTID("FtOn"));
};
function cTID(s){ return app.charIDToTypeID(s); };
function sTID(s) { return app.stringIDToTypeID(s); };
I did try DialogModes.NO, .ALL, and .ERROR with no change.
creating an action with a script
-
Mike Hale
creating an action with a script
Did you run this in ESTK? Or was ESKT running in the background with Photoshop set as the target app?
It works for me if I run it through the File-Scripts-Browse menu. It creates a new action with only one step and that is a scripts step with the path to the file. However it does leave the action in record mode. It even plays back without creating an error which I thought it would because the action now exists.
It works for me if I run it through the File-Scripts-Browse menu. It creates a new action with only one step and that is a scripts step with the path to the file. However it does leave the action in record mode. It even plays back without creating an error which I thought it would because the action now exists.
-
jamesrmac
creating an action with a script
Hi Mike! Yes I was running it from ESTK, and I meant to try it outside of ESTK, but I guess I never did. So the script works except I never meant to have anything in it. My intention was to leave the action blank and ready to start writing( although I dont care if its recording or not). The action I created this from did not leave it recording( I guess because it cant record an action while its playing an action).
So heres where I am now, I can not remove the script step from the action because it is recording, and I dont think i can stop it recording from a script.
Thanks for trying it out for me.
So heres where I am now, I can not remove the script step from the action because it is recording, and I dont think i can stop it recording from a script.
Thanks for trying it out for me.
-
Mike Hale
creating an action with a script
Well I can get it to remove the scripts step but it throws a confusing error that it can't delete the first step because there is no first step. If I put the delete in a try/catch it doesn't delete the steps.
I can't work out how to avoid that error message or stop the recording from a script.
I can't work out how to avoid that error message or stop the recording from a script.
-
jamesrmac
creating an action with a script
If I call this script from an action, it will be empty and not recording. Of course some of the other code in this script loads an atn using app.load, which doesnt seem to work if you call the script from an action.