AH MSave - Batch Actions & Scripts with Multiple Saves

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Tom, Kukurykus

Andrew

AH MSave - Batch Actions & Scripts with Multiple Saves

Post by Andrew »

Important Notice: I am currently in the process of releasing full non-beta versions of all my scripts and as of today - 18 Feb 2006 - am withdrawing all outstanding beta versions. To stay in touch with the full-release rollouts, subscribe to the thread:

Andrew Hall - Script Development, Update List

bb/viewtopic.php?t=190&start=15. ... 0&start=15

The new versions will have much improved dialogs, better integration with Bridge and many new features.

Andrew Hall 18 Feb 2006]

AH MSave, in conjunction with AH Script Launch, provides a framework for batching Photoshop Actions and Photoshop JS Scripts with Multiple Save As or Save for Web steps.

AH MSave is essentially a scripted version of Photoshop's batch which has the following extra features:

1. Ability to batch scripts, actions or a series of scripts and actions combined - in multiple stages.

2. Ability to save as many intermediate image files or final image file versions as you wish.

3. Ability to make each output file save to either a fixed target folder, or to a folder relative to the source image folder (for example you could send large web images to the subfolder LARGE and thumbnail images to the subfolder THUMB).

An example: you have a set of images, you want to run some pre-processing actions on the images (eg sharpen, noise reduction, curves) and then you want to run actions to create three web files, one large, one medium, one small. Aside from the resizing, you may want to do some individual processing of these three images, perhaps the thumbnail has more contrast applied to make it stand out, perhaps the large image has some more subtle sharpening that the other images do not need. As a final complication, you want these images saved to individual SMALL, MEDIUM, LARGE subfolders of the source image folder (bear in mind actions can only save to fixed folders, not a relative folders like this).

The individual steps are to be done by actions recorded by the user (or alternatively by scripts). What AH MSave does is handle process order, file naming and file destination. The role of AH Script Launch is then to send source files to AH MSave one at a time in order to create a batch image processing system.

Diagrammatically it looks like this:



You start off with a Source Image, do some pre-processing via Actions or Scripts to create a Base Image, then run more actions / scripts to process and save the individual final output images. You have the choice of deleting or keeping both the Source Image and the Base Image.

Here is an example set-up for an actions based run. Note the actions are ALL contained in a single Action Set called SaveImages.



The Save Steps used by the action can be either Save As or Save for Web (alternatively they can be embedded in a processing script). In either case they define a Save Path to a specific folder. AH MSave alllows you to override these fixed paths to send your files to either different fixed target folders, or to subfolders (or even parent folders) relative to the Source Image Folder.

This is the AH MSave Dialog, it is mostly pretty self-explanatory.



There are three versions of the AH MSave script:

ah-msave.js - opens the dialog and runs the script on one source file at a time
ah-msave-set.js - opens the dialog and saves the settings but does not process the images.
ah-msave-nd.js - processes the open image using the saved settings

When you want to batch a set of images you define the run settings using ah-msave-set.js, then you select a group of images in conjunction with AH Script Launch (these can be target folders, or files selected in either Bridge or the File Browser, and subfolders can also be scanned).

Then you run ah-msave-nd.js in Batch Leave Open mode from AH Script Launch:



I will describe all this in more detail shortly, this is a brief intro for now.

Andrew

Oh yes, download the companion batching script AH Script Launch 2 here:

bb/viewtopic.php?t=238

[Monday 5th December - new version including bugfixes]
Andrew

AH MSave - Batch Actions & Scripts with Multiple Saves

Post by Andrew »

IMO the most interesting and powerful aspect of AH MSave is the ability to batch process images with any combination of scripts and actions that the user chooses (remembering Photoshop batch cannot work with scripts, or actions containing scripts, at all).

Working with the web processing example from the previous post, many users would immediately say - 'The trouble with using actions for the save for web process is that I need to resize portrait oriented images differently from landscape oriented images, and for that I have to use a script. What's more, once I have used the script to resize I would prefer to use an action to save the image because then I can easily change the save-as settings when I want'.

No problem! Join the resize script and the save-as action (and any number of other scripts and actions as you require) using the script ah-chains.js, save the resulting script (mbatch1.js in the example) and make that the target for AH MSave for the first processing step.

Here is the ah-chains.js dialog - as you can see it is extremely simple and easy to use. All you need to know is the name of the scripts and actions (and containing actions sets) that you want to link up together.



The above creates a new script in your scripts folder called mbatch1.js. All you do now is replace your initial save-as process - which originally targeted the action called Act80, with mbatch1.js. That's it!

Diagrammatically, what we are doing is replacing the first Process and Save Action steps with a script that gives us a lot more power and flexibility.



For more info and download of ah-chains.js go here:

bb/viewtopic.php?t=241

By combining AH Script Launch, AH MSave and AH Chains you can batch complex image selections through any number of scripts and actions with as many individual save steps as you wish along the way.

Andrew
Andrew

AH MSave - Batch Actions & Scripts with Multiple Saves

Post by Andrew »

You should work through the options in the order they appear in the dialog.

They take time to get right on the first run but they are remembered on subsequent runs, and in fact you can save particular groups of settings using the Load and Save buttons at the bottom of the screen.



Number of Save Actions: The number of actions or scripts, excluding the preprocessing action or script (which could include it's own save), that you target - equivalent in the flow chart to the number of Final Images.

Use Action Save Paths: where you do not want AH MSave to move the images from where they are saved by their respective actions or scripts.

Delete Source Image: what it says, deletes the original opened image (usually sent by the the batching script). The script is designed to avoid deleting the source image unless you tick this box.

Save Pre-Processed Image: Saves the Base Image after it has been through the Pre-Processing action or script.

Details:

You can of course change the format of the image (say from Tif to JPG) during PreProcessing via your own action or script - the image will be saved in the format it is in AFTER pre-processing is finished.

If the format has changed, the original format base image (not the source image) will be deleted. It will not be deleted if it has the same name as the source image.

If Save Pre-Processed Image is NOT ticked, but you save the Base Image as part of your pre-processing script or action - via a save-as step - then that image, at that point in time, is saved. AH MSave will not delete the image, but it will also not save it again.

Save Folder Relative To Source:

If ticked the final image folders are specified RELATIVE to the Source Image folder. So, if the source is in /c/images1 and the Target is specified as 'WEB' then final images get sent to /c/images1/WEB.

If unticked then the folder target address is absolute and does not vary with source folder.

Details:

Your target save actions or scripts initially save the processed images to their own target folders. From there AH MSave moves the images to the desired final locations, and, after checking the move has been successful, deletes them from their initial location.

Move Base Image: This allows you to move your Base Image to a fixed folder. If left as 'Optional' the Base Image is Saved to the Source Image folder.

Of course this only applies if you select to save the Base Image in the first place.

Details:

If you would prefer to save the Base Image to a Relative Folder Address you can do it by: unticking Save PreProcessed Image, creating an extra first save-as step with an action (or script) to save the Base Image after all, and then use the Target Folder controls to send this image to a Relative Folder Target.

Base Image Name

If you enter prompt in the text box, you will be prompted for a name for every source image.

If you enter anytext this will be added as a suffix to the source image name so myimage.jpg becomes myimageanytext.jpg.

If you leave the field blank, the the source image will be used - with all the implications of overwriting or deleting yuor source image.

Action Save Path

This is the path specified for saving in your save actions. If all actions point to the same folder you can enter a single path, otherwise you must enter one for every action.

Because the dialog remembers the existing setting you must clear room for any new settings you add - the dialog issues an error message if you do not either have 1 path, or the same number of paths as Number of Save Actions (top box of all).

There is not room to list all your action paths, so if you want to see the whole list hit the LIST button to the right.

Target Folder this is where you want to saved files to end up. Again you can either define 1 target, or as many targets as Number of Save Actions. Again, you can use LIST to see all the targets.

Save As Suffix

For every one of your save-as steps, you need a create a unique output file. This is added as a suffix to the Base Image name. So, if the base image is test-base.jpg, then specifying '-1' creates test-base-1.jpg for the first action output. There must be one entry here for every save action step.

Action Set Name The action Set containing ALL you actions, including any preprocessing actions.

Pre-Processing Action name - what it says. If left blank, no preprocessing will be done but the base image will still be renamed if required.

Save ActionsThe name of each of your save actions.

Save Extensions The extensions of the saved files created by your save actions. Note these do NOT change what the file is saved as by your action, they merely allow the script to find the file once the action is finished. If all the Extensions are the same you can specify a single value.

Wheeew, that's it for now.

Andrew
Andrew

AH MSave - Batch Actions & Scripts with Multiple Saves

Post by Andrew »

I am currently working on a new version that will allow you to vary the process flow such that instead of Final Images always being derived from scratch from the base image, they can also be derived from the previous Final Image.

Andrew
Andrew

AH MSave - Batch Actions & Scripts with Multiple Saves

Post by Andrew »

I have released version 1.03 which fixes a couple of bugs that caused problems when you changed the extension of the target images.

Andrew Hall