1

I put this question in Adobe Photoshop Forum and Adobe Photoshop Scripting Forum more than a month ago and I didn't get any solution. I try here.

Doing actions for third-party users, in the testing process many steps and stops are created while the action progress. Once finished, the action ends with dozens of hidden steps that I must eliminate before making the delivery. This process is manual, selecting the hidden actions one by one without any wrong step, and deleting them. It would be great to have the option to automatically select all the hidden actions and eliminate them in a click, but apparently it doesn't exist.

Does anyone know any script or the way to make this process less tedious?

enter image description here

1

Maybe someone will have a more definitive answer, but there're several points.

I don't think there's an easy way to know if an action step is enabled or not. However, there's this amazing person, xbytor, who made a huge library of different functions that he uses for his scripts. For a non-developer like me they're hard to read, but it includes a particular script: ActionFileToJavaScript.jsx, that writes an atn file to a jsx file(s), including the information about status of the steps. So if I had a task like yours,

  1. I'd export all actions as .atn
  2. convert them to .jsx with xbytor's script
  3. using a different script I'd read this file to find what steps are marked as disabled in which actions:

    step1();                  // Make
    step2();                  // Make
    step3();                  // Make
    step4(false, false);      // Make
    step5(false, false);      // Make
    step6(false, false);      // Make
    step7();                  // Make
    step8();                  // Make
    
  4. using an AM code from ScriptListener I'd then remove all the marked steps:

    var desc = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putIndex( cTID('Cmnd'), 4 ); //index of the step to remove
        ref1.putName( cTID('Actn'), "Action 3" ); //name of the action
        ref1.putName( cTID('ASet'), "Set 1" ); //name of the action set
    desc.putReference( cTID('null'), ref1 );
    executeAction( cTID('Dlt '), desc, DialogModes.NO );
    

or if you're a better coder than me you can just use his Actions library to get information you need directly from an .atn file.

  • It looks very interesting, I'll take a look when I have time. I'll let you know the result. – Danielillo Dec 17 '18 at 17:01
  • btw I just noticed that xbytor's scripts include ActionFileToXML and ActionFileFromXML, maybe it'd be even easier to use them: convert to XML, remove the disabled xml nodes using JSX, convert the resulted XML back to atn file. – Sergey Kritskiy Dec 17 '18 at 17:22
  • Yes, I had a quick look and saw several options, when I have something done I put it here. Thanks and let me see if this helps to accept your answer as valid. – Danielillo Dec 17 '18 at 17:40
0

I'm pretty sure that this isn't possible.

The whole idea of the "toggle on/off" option is so that there's a temporary way to (de)activate certain steps - so that you don't have to delete it.


Q: Can you automatically delete all (in)visible layers in Illustrator?
A: No, but with scripting it's possible.

I'm going to say the same thing applies with the actions. You may be able to get a script which will accomplish this.

  • That's what I'm looking for. – Danielillo Dec 17 '18 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.