Scripts
Scripts are files that define one or more transformations and the way they are connected to each other in the image tree. Script files perform several useful functions:
•Saving a record of your work on one or more images so you can pick up editing later right where you left off or make changes to any stage of the workflow.
•Applying the same sequence of operations to multiple images.
•Sharing work flows you have developed.
Save Script
To use the Save Script command, first select an image whose workflow you want to save − typically the last image in a branch of the image tree. Saving a script based on this image records all the transformations and tools you used to create the final image, all the way back to when you opened an original file(s). Script files are usually very compact as it just lists the commands and their parameters for each transformation and tool. If you performed a lot of free-hand retouching or masking, the file may be somewhat larger as each stroke you made is captured in the script file.
There are three forms of the Save Script command. While mostly the same, they deal differently with the original image files on which the final image depends.
Save Script with Image Names…
This option includes the pathnames of the original files, but does not save the files themselves. This is the option to use when working on an image that you want to refine later.
Save Script without Image Names…
This option omits the pathnames of the original files. This lets you save the workflow you used to create an image and apply it to other image files. When you open a script without image names, Picture Window asks you for the names of the files you want to open. When asking for pathnames, the initial folder is set to you default folder if the original file was opened with File/Open from Default. Otherwise the initial folder is the one used by the last File Open command.
Save Script with Image Copies…
This option saves TIFF copies of all the original files in a folder with the same name as the script file. This option is useful for archiving images you might want to edit later, when you don’t want to worry about one of the original images being deleted, edited or renamed in the interim. Files are saved with their original filenames to make it easier to tell where each one came from. In the event that two or more files have the same filename (presumably because they had different extensions or came from different folders originally), subsequent filenames are made unique by appending a file number.
File Modified Date and Time
In addition to saving all the commands, script files also include the time and date each input file was last modified. When a script is reloaded, the saved time and date is compared to the current modification date to make sure the file has not been changed since it was used as part of the script. If there is a discrepancy, you have the option of proceeding with the modified file or canceling. If you don’t get a warning, the input files are all the same as the ones you originally used.
Save Script Options
The advantage of Save Script with Image Names is that you use less disk space and, if the original file is reworked, those changes will be reflected in the result image when the script file is subsequently opened. The disadvantage is that if you happen to delete or modify one or more of the files from which the result image was created, you will no longer be able to use the script file to recover the result image. This situation can also arise if the original file was obtained by pasting it from the clipboard or from some other non-repeatable source.
If you use Save Script with Image Copies, the original images from which the result image was created are saved along with the script file and you should be able to recover the result image even if one of the original files was deleted or if the image came from the clipboard. On the other hand, if you rework one of the original files after saving the script and images, those updated files will not automatically update the result image since Save Script and Image Copies effectively creates a snapshot in time and the result image will never change. However, after loading the script you can manually reload whatever input images you want to refresh and then you can re-save the script with the updated files.
Open Script…
The Open Script command first asks for a script filename to open. If the open is successful the commands contained in the script file are re-played, restoring the final image and all the intermediate images from which it was created. If the script was saved without image names, you will be asked to open the files to which you want to apply the script.
You can also open script files using the File Open command, as long as you select just the script file. This is more convenient than using Open Script if the script file is stored with other image files since Open Script always searches for script file in the default script folder.
For reference, the filename of the last script (or workspace script) file opened is displayed in the main window caption.
The Current Script
Each time you load or save a script or workspace script file, its pathname is recorded as the current script. The filename of the current script is displayed in the title bar of the main window so you can tell what script you are currently working on.
Workspace Scripts
In addition to the save and open script commands described above, there is a parallel set of commands for saving and loading workspace scripts. They are similar except:
Regular scripts save only the information needed to reconstruct the current image at the time the script was saved. Regular scripts have the file extension: .script.
Workspace scripts save a script that reconstructs all the images in the entire image tree. Workspace scripts have the file extension: .workspace.
Saving and Restoring Workspace Scripts between Sessions
Just before you shut down Picture Window, it automatically saves a workspace script (unless the workspace is empty) under the name Previous.workspace so you can pick up where you left off in the next session. When Picture Window starts up, it can be configured to ask to open a saved workspace file. The process of asking to save or load a workspace file can be turned on or off via settings in the File/Preferences dialog box.:
For more information, see File/Preferences.
Whether or not Picture Window asks to load a workspace on startup, you can achieve the same effect with the Script/Open Workspace Script... command.
You can also configure Picture Window to ask to save the current workspace just before you erase all the images in the workspace. This can happen when you issue a File/Close All Images command or when you open a script or workspace script.
Autosave
If Autosave (in File/Preferences) is set to Yes, a workspace script is automatically generated and saved with the name Autosave.workspace every time you click OK or Apply in a transformation dialog box, or when you close or copy an image or clear the workspace. This feature lets you recover your work if Picture Window or your computer crashes or if you accidentally delete one or more images. The last five versions of this file are also retained in case you want retrace your steps and go back to an even earlier version of the workspace. These additional files are name Autosave1.workspace ... Autosave5.workspace (most recent to least recent). As with any other workspace file, use Script/Open Workspace Script to open the file and restore the saved workspace.
Recover Workspace
The Script/Recover Workspace command displays a dialog box to let you restore one of the following saved workspace script files:
The Load control let you select which workspace file to open:
Last Session -- Opens the workspace file Previous.workspace (if any)
Last Loaded or Saved -- Opens the workspace you last loaded or saved by name to (if any)
Autosave -- Opens the workspace file Autosave.workspace (if any)
Autosave1..5 -- Opens one of five previous versions of Autosave.workspace (if any)
The filename and folder of the workspace file that will be opened are displayed below the Load control.
File Save
Picture Window lets you save a script file, either with images or with image copies, along with every image file you save. This script file is saved in the same folder and has the same filename as the image file but with the extension .script. This feature lets you recover and modify all the work you did to create the image.
Tips
Save Script with Image Copies
Use this to archive work you want to come back to later without having to worry about some of the original files being modified, deleted or unavailable.
For example, say you create an image you print and offer for sale. You can use Save Script and Images to preserve a copy of the original image(s) and your workflow. This documents exactly how the final image was created and lets you restore both the original images and the workflow later. You can then modify the workflow to refine the image later if you wish to tweak the image or simply reload it to make another copy of the image to print.
To be extra safe, make sure you save the final image as well as the script that produces it in case there is some problem running the script under a newer version of Picture Window.
Saving image copies facilitates moving your work to a different computer. If you transfer the script file and its image folder, you should be able to continue your work on the other computer by opening the script file.
When saving with images, the script file and image folder must be within the same folder, although you can move them both to a new folder if you wish. If you move the script file and its image folder to different folders, the script file will not be able to find the images and the Open Script command will fail.
Save Script with Image Names
Use this to save a workflow when you know all the original files will remain available.
Save Script without Image Names
Use this if you create a workflow that applies a sequence of operations to an image to get a specific effect and want to apply them to different images later.
Running Scripts on Startup
You can open Picture Window and run a script when it starts up by specifying the name of a script file in its command line or by using the Open With… command in Windows Explorer to register Picture Window as the application to open files with the extensions: .script and/or .workspace.
Organizing Script Files
By default, workspace scripts are saved in My Documents/Picture Window Pro/Workspace Scripts, although you can save them anywhere you prefer. If you have a lot of workspace files, you may want to organize them into sub-folders within the default folder. Scripts are saved by default in the last folder in which a script or image file was saved. Script files saves as a side effect of saving an image file are saved in the same folder as the associated image file.
Creating Generic Scripts with Convert to Copy
Say you have a series of transformations you want to be able save and reuse later. One way is to use Save Script without Image Names as described above, and then open the script when you need it. This works if you want to apply the script to a different file, but not if you want to apply the script to an image in the middle of an existing branch. To make your script generic, use the Edit/Convert to Copy command just before saving your script to replace its File Open with a Copy transformation. When you load the script, instead of asking for a file to open, it will load with an empty Copy transformation as its top level image:
Next, double click on the Copy transformation and use the Input Image control to select the image you want to process with the script and finally click OK to close the Copy and recalculate.
If your script has more than one input image, replace each File Open with a Copy. In this case, it is a good idea to set the caption of each Copy so you can remember which is which.