
Script Library
In any publishing workflow there comes a time when the standard tools fall short and more advanced customization is in order. That is when you call on the scripting capabilities of PowerSWITCH. Some of these scripts are also supported in FullSWITCH through the configurators of certain third party applications.
Internal scripting in PowerSWITCH
- Add Job ID from Ad Ticket to hierarchy information
This is an example script that demonstrates how you can access information in a dataset of a job (in this case the 'Xmp' dataset that was created by the XMP Pickup tool) and how to add this information to the hierarchy information of a job. - Label Files with a Unique ID
This script demonstrates how you can use global data in a script. In this case the global data is used to hold a unique ID and the name of every processed job is prefixed with that unique ID. - Sort on Job Size
This is an example script that shows how you can retrieve the size of a job (file or job folder) and use that to filter files into one or the other direction. - Add Partial Job Name to hierarchy information
This is an example script that reads the first 3 characters of each incomming job and adds them to the hierarchy information as an extra level. - Archive By Date
Each time a new job arrives, the current date is added to the hierarchy information of a file. This allows you to create a folder structure per year, month or day using the Archive hierarchy tool.
- Set User Name
This script set the user name for all incoming jobs in their respective job tickets. - Sort job based on JDF metadata
This is an example script that shows how information from the JDF metadata associated with a job can be used to filter files.
- Sort job based on XMP metadata
This is an example script that shows how information from the XMP metadata associated with a job can be used to filter files.
-
Detect Font Courier in PDFSpy data
This particular example assumes PDFSpy has been used on a PDF job; it detects whether fonts named "Courier" exist in the processed PDF file. - Add XMP job ID to file name
This script shows how you can retrieve a field from the metadata associated with a job and use it to change the name of the job.
- Recycle Bin
This script defines a number of parameters that determine when a file should be deleted permanently. E.g. file size, number of files, age, etc. - Change EXIF information
This script is used to change the EXIF information using the EXIFutils tools. - Retrieve EXIF information
This script uses the EXIFutils command-line tools to retrieve the EXIF information for each incoming file and adds it to the metadata of that respective file.
- Strip Prefix and Suffix
This script can be used to strip prefixes and suffixes from the job name. You can define which part of a file name needs to be removed by changing the "Prefix" and "Suffix" property on the script element.
- Filter on PitStop XML Report
This script can be used for routing jobs dependent on the result of the PitStop Server preflight report after adding it to the metadata.
- Sort files on FlighCheck Online metadata (TFS)
Jobs received through FlightCheck online contain metadata. This example script shows you how to use this metadata to filter files through connections with different settings.
Scripted Configurators
- Scripted configurator (callas pdfInspektor)
This example JavaScript shows how to use SWITCH scripting to write a complete SWITCH configurator.
AppleScripts for PowerSWITCH
- Sort job based on XMP metadata
This is an example AppleScript that shows how information from the XMP metadata associated with a job can be used to filter files.
Visual Basic Script for PowerSWITCH
- Log job information to Excel
This is an example script that shows how to access information from a job and log it into an Excel spreadsheet.
- Change job name
This is an example script that renames a job as it is processed.
- Sort PDF by number of pages using Acrobat
This example script drives Adobe Acrobat to query the number of pages from a PDF file.
JavaScripts for Adobe CS2/CS3 applications
- Save as PostScript - Adobe Illustrator
This script will print an Illustrator file to PostScript using a selected Print Preset.
- Save as PostScript - Adobe InDesign
This script will print an InDesign file to PostScript using a selected Print Preset.
- Update links in InDesign
This script opens an InDesign file or Package and updates all linked files. - Extract even and odd pages - Adobe Acrobat
A JavaScript in the Adobe Acrobat configurator is used to do remove the even or the odd pages in a PDF file.
- Summary of annotations - Adobe Acrobat
Acrobat is used to make a summary of the annotations resulting in a file that shows you the page content and the annotations per page. - Change document info - Adobe Acrobat
This JavaScript for Acrobat adds information to the following document info fields: title, author, subject, keywords and creator. - Sort on color mode - Adobe Photoshop
This flow demonstrates the use of the variable 'Color Mode' to sort images by colorspace. As the 'Color Mode' variable is added to a file by Photoshop, the Photoshop configurator is used to open incoming files and save them, thereby updating the metadata in the images with the Color mode value which is used afterwards to sort on.
