7 Replies Latest reply: Nov 24, 2009 11:56 AM by Paul Riggott RSS

    batch scripting ?

    Christian Davideck Community Member

      Hi folks. I need to use a script I wrote on all files in a given folder. How can this be achieved ?

       

      I thought of batch processing, but the menu file>>automate>>batch… only works with actions, not with scripts.

       

      many thanks.

        • 1. Re: batch scripting ?
          Paul Riggott Community Member

          Record a new actions that calls the script, Start a new recording and from the action paltte fly out select "Insert Menu Item" then File - Scripts and select your script, stop the recording. You can now use this action in batch.

          • 2. Re: batch scripting ?
            Christian Davideck Community Member

            Yeah, I didn't think of that one ...

            many thanks!

             

            Is the workaround via action recording the only way? I find it kind of weird, that file > automate > batch only accepts actions as input, not scripts

            • 3. Re: batch scripting ?
              Paul Riggott Community Member

              Yes, the alternative is to write a script that does everything that you want it to do, this way you have more control.

              • 4. Re: batch scripting ?
                Christian Davideck Community Member

                Okay, thank you Paul.

                 

                I would have found it logical, that both scripts and actions can be used by the batch processor, but I guess there's no point in stating that, except for making a feature suggestion to Adobe.

                 

                Anyways, I've found a tool, that seems to overcome this limitation:

                 

                http://www.ps-scripts.com/bb/viewtopic.php?t=323

                 

                It's called AH MSave (and AH Script Launch). The design/logic of it seems a bit complicated to me at first glance though and I haven't found where to download it. The author stated "Photoshop batch cannot work with scripts, or actions containing scripts, at all". But that was back in 2005, so I hoped that Photoshop would have made progress since then, making the use of this tool unnecessary. But apparently, that's not the case.

                 

                By the way, is it still true today that "Photoshop batch cannot work with scripts, or actions containing scripts, at all" ? If so, wouldn't that contradict :

                 

                Paul Riggott wrote:

                 

                Record a new actions that calls the script, [...] You can now use this action in batch.

                 

                 

                 


                • 5. Re: batch scripting ?
                  Paul Riggott Community Member

                  There can be a problem of a script calling a script.You can eval/$.evalFile a script to run it so it is possible to write your own batch processor, but I find it easier to start from scratch.

                  • 6. Re: batch scripting ?
                    Christian Davideck Community Member

                    Paul Riggott wrote:

                     

                    ... but I find it easier to start from scratch.

                     

                    Well, that's because you are skilled! Me - and I guess other beginners as well - would certainly appreciate to use scripts in Photoshop's batch processor, too, instead of writing everything from scratch.

                     

                    But anyway, I found some code examples on the net and added them to my script. I'm sorted out now

                    Thank you for having helped me all along on this, Paul!

                     

                    PS: If you can have (just a quick) look on the link I posted above ... what's your impression at first glance ?

                    • 7. Re: batch scripting ?
                      Paul Riggott Community Member

                      Andrew has done some fantastic scripts but I don't think they have been updated for a number of years and I've never used them so can't comment. You can't batch all scripts, it depends on what they do and what dependancies they have.