templator
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| templator [2018/03/10 02:13] – [Export Image] o2admin | templator [2026/10/25 02:53] (current) – Help pages updated for PowerScripts 3.8 (help pages session) remoteuser | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Templator | + | ====== |
| + | |||
| + | Make proofs, approval forms and job folders in one click. Templator opens your template, brings in the selected artwork, fills in the job details (typed in, worked out from the document, or fetched from your job system), then saves the file, a PDF and a JPG where they belong. | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ===== Where to find it ===== | ||
| + | |||
| + | Open the PowerScripts panel (**Window > Extensions > PowerScripts**) and choose **Templator** from the **Tools** scripts. The script has three tabs: **Quick Create**, **Template Options** and **Help**. | ||
| + | |||
| + | ===== Quick start ===== | ||
| + | |||
| + | - On **Template Options**, under **Template**, | ||
| + | - Under **Find | ||
| + | - Under **Artwork**, | ||
| + | - Press **Apply Template**, and save the settings as a preset: it then shows on **Quick Create**, ready to double click next time. | ||
| + | |||
| + | ===== What it can do ===== | ||
| **Templator will** | **Templator will** | ||
| Line 7: | Line 24: | ||
| * Copy the selected artwork in the current document and place it on the template, and rasterize it. | * Copy the selected artwork in the current document and place it on the template, and rasterize it. | ||
| * Ask the user for custom information, | * Ask the user for custom information, | ||
| + | * Run your own code to fetch extra data | ||
| * Automatically replace text in the document such as date, name and any other text you want | * Automatically replace text in the document such as date, name and any other text you want | ||
| * Connect to a URL to get information from a website or database, for example, enter in a job number and return the job name and customer details | * Connect to a URL to get information from a website or database, for example, enter in a job number and return the job name and customer details | ||
| Line 16: | Line 34: | ||
| **Typical uses** | **Typical uses** | ||
| * Create a job folder with sub-folders and save a blank working file. | * Create a job folder with sub-folders and save a blank working file. | ||
| - | * Copy the selected artwork and create an approval | + | * Copy the selected artwork and create an approval |
| + | |||
| + | ===== Options ===== | ||
| - | ====== Quick Create | + | ==== Quick Create ==== |
| {{: | {{: | ||
| Line 24: | Line 44: | ||
| This tab lists the previously saved settings, double-click to load the template settings and create a template. | This tab lists the previously saved settings, double-click to load the template settings and create a template. | ||
| - | ====== Template Options | + | ==== Template Options ==== |
| {{: | {{: | ||
| Line 50: | Line 70: | ||
| + | |||
| + | ---- | ||
| ==== Find and Replace ==== | ==== Find and Replace ==== | ||
| Once the template is opened or embedded you can find and replace text in the template. | Once the template is opened or embedded you can find and replace text in the template. | ||
| Line 57: | Line 79: | ||
| * **Type Column** | * **Type Column** | ||
| * **Text** Replace with text in the //Default Text/ | * **Text** Replace with text in the //Default Text/ | ||
| - | * **Date** Replace with the current Date, See below for date formatting options | + | * **Date** Replace with the current Date, See bottom of document |
| * **Document.name** Replace with document name | * **Document.name** Replace with document name | ||
| * **Document.folder** Replace with document folder | * **Document.folder** Replace with document folder | ||
| * **Document.filename** Replace with document filename | * **Document.filename** Replace with document filename | ||
| * **Document.artboardCount** Replace with number of artboards in the document (excluding newly created template artboard) | * **Document.artboardCount** Replace with number of artboards in the document (excluding newly created template artboard) | ||
| - | * **Document.colorSpace** Replace with ' | + | * **Document.colorSpace** Replace with ' |
| - | * **Artboard.width** | + | * **Artboard.width** |
| - | * **Artboard.height** | + | * **Artboard.height**See Size formatting below |
| - | * **Artboard.number** the number of the artboard selected prior to creating the template | + | * **Artboard.number** the number of the artboard selected prior to creating the template |
| + | * **Selection.width** | ||
| + | * **Selection.height** See Size formatting below | ||
| + | * **Selection.count** the number of selected items \\ \\ | ||
| * **User Text Input** Prompts the user for text | * **User Text Input** Prompts the user for text | ||
| * //Default Text/ | * //Default Text/ | ||
| - | * //Input Validation// | + | * // |
| * //User Input Label// column contains the label for the form | * //User Input Label// column contains the label for the form | ||
| + | * The text to find will ways be wrapped with {} brackets, so if your find text is " | ||
| * **User Number Input** Prompts the user for text | * **User Number Input** Prompts the user for text | ||
| * //Default Text/ | * //Default Text/ | ||
| - | * //Input Validation// | + | * // |
| * //User Input Label// column contains the label for the form | * //User Input Label// column contains the label for the form | ||
| + | * The text to find will ways be wrapped with {} brackets, so if your find text is " | ||
| * **User Dropdown Input** Prompts the user for text | * **User Dropdown Input** Prompts the user for text | ||
| * //Default Text/ | * //Default Text/ | ||
| - | * //Input Validation// | + | * // |
| * //User Input Label// column contains the label for the form | * //User Input Label// column contains the label for the form | ||
| + | * The text to find will ways be wrapped with {} brackets, so if your find text is " | ||
| * **Default Text/Format Column** | * **Default Text/Format Column** | ||
| * The default value for the form | * The default value for the form | ||
| Line 83: | Line 111: | ||
| * **Input Validation Column** See the User Input Validation Rules at the bottom of this page | * **Input Validation Column** See the User Input Validation Rules at the bottom of this page | ||
| * **User Input Label Column** The label to show on the form if empty the find text will be used as a label | * **User Input Label Column** The label to show on the form if empty the find text will be used as a label | ||
| + | |||
| + | ---- | ||
| + | |||
| + | == Size formatting | ||
| + | You can format the height, width and scale in the //Default Text/ | ||
| + | |||
| + | The formatting is " | ||
| + | * **units** Such as ' | ||
| + | * **decimals** (Optional, default=2) The number of decimal points to display | ||
| + | * **scale** | ||
| + | |||
| + | Examples | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | |||
| + | |||
| + | ---- | ||
| + | ==== Scripting ==== | ||
| + | |||
| + | **Run script as**: **Do not run**, **ExtendScript in Illustrator**, | ||
| + | |||
| + | |||
| + | You can run Extendscript or Javascript to modify the document and return additional text changes to Templator. Your code will be wrapped in a function, so ensure that you include a return statement with the required data structure. | ||
| + | |||
| + | Your code must return the standard object indicating success and any error messages/ | ||
| + | |||
| + | **Warning: Make sure your code is self-contained and does not pollute the global scope** | ||
| + | |||
| + | ==ExtendScript in Illustrator== | ||
| + | * Runs the code in Extendscript in Illustrator allowing you to modify and get information from the document. | ||
| + | * Note that ExtendScript and not modern ES6 Javascript and does not support the latest features of Javascript. see[[ https:// | ||
| + | |||
| + | == Extendscript Example == | ||
| + | <code javascript> | ||
| + | var d = new Date; | ||
| + | var success = false; | ||
| + | |||
| + | data.textChanges.push({find: | ||
| + | data.textChanges.push({find: | ||
| + | |||
| + | if(success){ | ||
| + | return { | ||
| + | success: true, | ||
| + | data: data | ||
| + | }; | ||
| + | } | ||
| + | |||
| + | return { | ||
| + | success: true, | ||
| + | errorMessage: | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | == Javascript in CEP/NodeJS == | ||
| + | * Runs the code in the CEP Panel of PowerScripts, | ||
| + | * Note that the following libraries are already loaded CSInterface, | ||
| + | * You can run ExtendScript code using CSInterface.evalScript. | ||
| + | * To asynchronously get data, return a Function, This function will be called with the first argument data and the second a callback | ||
| + | |||
| + | == Javascript/ | ||
| + | <code javascript> | ||
| + | return function getWebsite(data, | ||
| + | | ||
| + | | ||
| + | | ||
| + | }); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| ==== External Data ==== | ==== External Data ==== | ||
| - | This gives you the option of retrieving data from an external source, such as a custom webpage linked to a database. | + | This gives you the option of retrieving data from an external source, such as a custom webpage linked to a database to Find and Replace text. |
| - | * **URL** contains the URL address, Note that this can contain find and replace characters, so, for example, you can use http:// | + | |
| - | The server must return data in the following JSON object\\ | + | * **URL** contains the URL address, Note that this can contain find and replace characters, so, for example, you can use '' |
| - | '' | + | |
| - | '' | + | The server must return data in the following JSON object, see below |
| - | '' | + | |
| - | '' | + | ---- |
| - | '' | + | ==== External URL and Javascript Return Data Format==== |
| - | '' | + | The Javascript Extendscript must return the following, and the external webpage must return this in JSON. |
| - | '' | + | |
| + | <code javascript> | ||
| + | { | ||
| + | success: | ||
| + | errorMessage: | ||
| + | data: { | ||
| + | textChanges: | ||
| + | {find: "{animal}", type: "text", value: " | ||
| + | ] | ||
| + | | ||
| + | } | ||
| + | </ | ||
| * **success** is required. Boolean true or false | * **success** is required. Boolean true or false | ||
| * **errorMessage** is optional. When success=false this message will be displayed. | * **errorMessage** is optional. When success=false this message will be displayed. | ||
| - | * **data** is an object, with property-value pairs, The program will add curly brackets to the property name and replace that with the value. So in the example above " | + | * **data.textChanges** is an array of objects, {find: " |
| + | * Replacement types: | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | * ' | ||
| + | |||
| + | |||
| + | ---- | ||
| ==== Artwork ==== | ==== Artwork ==== | ||
| This option allows you to copy the currently selected artwork to the template and resize it. This has been designed for creating approval forms. | This option allows you to copy the currently selected artwork to the template and resize it. This has been designed for creating approval forms. | ||
| Line 109: | Line 237: | ||
| * **Move X/Move Y** Allows you to move the artwork to an exact position on the artboard. | * **Move X/Move Y** Allows you to move the artwork to an exact position on the artboard. | ||
| + | |||
| + | ---- | ||
| ==== Folders ==== | ==== Folders ==== | ||
| * **Create Folder** Enter the folder name to create, you can include find and replace variables in there too, such as [ C: | * **Create Folder** Enter the folder name to create, you can include find and replace variables in there too, such as [ C: | ||
| * **Sub Folders** Create multiple subfolders by separating folder names with a comma | * **Sub Folders** Create multiple subfolders by separating folder names with a comma | ||
| - | * **Open folder** Tick to open in OSX Finder or Windows Explorer after being created | + | * **Open folder** Tick to open in macOS Finder or Windows Explorer after being created |
| + | |||
| + | ---- | ||
| ==== Save ==== | ==== Save ==== | ||
| Saves the document as an Illustrator file | Saves the document as an Illustrator file | ||
| Line 128: | Line 260: | ||
| * **Prompt for Filename** If unticked then the PowerScript will save without asking to confirm the filename | * **Prompt for Filename** If unticked then the PowerScript will save without asking to confirm the filename | ||
| + | |||
| + | ---- | ||
| ==== Export PDF ==== | ==== Export PDF ==== | ||
| Exports the document as an Illustrator file | Exports the document as an Illustrator file | ||
| Line 148: | Line 282: | ||
| + | |||
| + | ---- | ||
| ==== Export Image ==== | ==== Export Image ==== | ||
| Exports the Template Artboard as an Image | Exports the Template Artboard as an Image | ||
| Line 165: | Line 301: | ||
| * **Transparent PNG/PSD** Enable transparency in PNG and PSD files | * **Transparent PNG/PSD** Enable transparency in PNG and PSD files | ||
| - | ====== | + | ==== Post ExtendScript |
| + | |||
| + | * **Execute ExtendScript after all other actions completed**: | ||
| + | |||
| + | * **Apply Template**: does it. | ||
| + | |||
| + | ===== Date formats | ||
| ^ Mask ^ Description | ^ Mask ^ Description | ||
| Line 201: | Line 343: | ||
| - | ====== Unit Formats | + | ===== Unit formats |
| ^ Abbreviation ^ Singular ^ Plural ^ note ^ | ^ Abbreviation ^ Singular ^ Plural ^ note ^ | ||
| | ft | foot | feet | | | ft | foot | feet | | ||
| Line 217: | Line 359: | ||
| - | ====== User Text Input Validation ====== | + | ===== User text input validation |
| Line 237: | Line 379: | ||
| - | ===== Release Notes ===== | + | ===== What's new ===== |
| - | + | ||
| - | ==== Version 1.3.0 ==== | + | |
| - | * Added: Support for PNG, TIFF and PSD (Photoshop) image exports | + | |
| - | * Added: Support for transparent image export | + | |
| - | * Added: Ability to choose "Do not import any templates" | + | |
| - | * Added: Checkbox for find and Replace to turn this feature off | + | |
| - | * Minor Fixes | + | |
| + | * **2.2.3** | ||
| + | * Improved: new documents use 300 ppi raster effects (shadows, blurs, rasterizing), | ||
| + | * Fixed: {Artboard.number} and the PDF range Current artboard use the right artboard when the template is a new document. | ||
| + | * Improved: safer when working with more than one document. Needs PowerScripts 3.8.42 or later. | ||
| + | * **2.2.2** | ||
| + | * Improved: Copy Selected Artwork no longer uses copy and paste, so your clipboard is left alone. | ||
| + | * Fixed: Copy Selected Artwork works into a new template document and with No Action, and no longer crashes Illustrator. | ||
| + | * Fixed: running from a hot key, quick key or automation works, Execute ExtendScript after all other actions runs your code again, and the regex: and wordafter: formats work. | ||
| + | * Improved: general bug fixes, reliability and speed. | ||
| + | * **2.2.0**: Copying a template from another file is more reliable (no more copy and paste, so your clipboard is left alone). | ||
| + | * Older changes: [[releasenotes|PowerScripts Release Notes]] | ||
templator.1520648014.txt.gz · Last modified: by o2admin