Scripts

<< Click to Display Table of Contents >>

Navigation:  Advanced >

Scripts

What is a script?

A script is a collection of preset instructions that enables the automatic execution of a user-defined task in BatchPhoto.

The main advantage of scripts is that they can be executed through Windows' command line and by using a task scheduler you can automatically run multiple scripts at a certain time.

How to create a script

BatchPhoto gives you the possibility to create your own scripts which can be launched at a later time. In order to create a script you must first adjust BatchPhoto's settings according to your desired task. The complexity of a task may vary from a simple picture re-size to a complex multi-filter photo processing followed by an upload to a FTP server. After you have defined your task, in order to save it as a script, take the following steps:

Select FileSave Script from the main menu.

Type the script's name in the File name field.

You will be asked if you want to disable all warnings during processing in order to enable the script to run in a task scheduler. By disabling the notifications you agree to automatically delete source photos (if you chose this option) and disable warnings for overwriting images.

Press Save.

A script with your current settings will be created. When this script is launched BatchPhoto will automatically start executing your task.

How to launch a script

You can launch a script by double-clicking on the icon of a .bps file or using Windows' command line.

The first approach is straightforward and needs no further explanations. Simply double-click on the desired script and BatchPhoto will automatically start executing your script's task.

The second approach requires you to launch your Windows' command line and write a command with the following standard syntax: > [Path to the script you want to load] \ [Script name].bps

Example: > C:\Users\User\Documents\BatchPhoto\Scripts\MyScript.bps

How to edit a script

After you have created the script using BatchPhoto's interface you can further modify/customize it by manually editing the corresponding .bps file. A BatchPhoto Script File is actually a XML file which has the following three main types of nodes: Images, Filters and Properties.

The Images node can have the following two types of nodes as children: Image and Search.

An Image node corresponds to an image from the image list. The Image node stores the path of it's corresponding image in the Path attribute.

Example: <Image Path="C:\Users\Developer\Pictures\Test Batch Photo\Untitled.png" />

A Search node corresponds to a search pattern that can be manually defined. All the photos that match the pattern will be added to the list of images that are going to be processed.

Example: <Search Path="C:\Users\Developer\Pictures\Test Batch Photo\*.jpg" />

You can also search all the subfolders of a given folder by using he Subfolders attribute.

Example: <Search Path="C:\Users\Developer\Pictures\Test Batch Photo\*.jpg" Subfolders="1" />

Relative paths can also be used in defining the search pattern.

Example: <Search Path="..\Test Batch Photo\*.*" />

The Filters node contains the list of graphical filters that will be applied on all images added in the Images node. Each filter has a list of parameters that is not indicated to be edited manually.

The Properties node contains properties for: Rename, Output destination, Output format, User interface, and so on.

It must be noted that the options of disabling notifications and hiding the interface during processing can be edited directly from the script. Just modify the following section in the script:

<Properties Class="Script">

 <Property Name="DisableNotifications">1</Property>

 <Property Name="HideProcessing">0</Property>

</Properties>