please select your own LANGUAGE

Saturday, January 31, 2015

Importing data sets from external files

    You can quickly create a large number of data sets by creating an external text file that contains all the variable information and loading that file into a PSD document containing variables. One good way to accomplish this is to enter your data into a text file and then export it to a tab or comma-separated file.
    The syntax of the external text file is as follows (where each line that starts with "Variable" or "Value" is an entire line by itself in your file):
    VariableName1<sep>VariableName2<sep> <sep>VariableNameN <nl>
    Value1-1<sep>Value2-1<sep> <sep>ValueN-1<nl>
    Value1-2<sep>Value2-2<sep> <sep>ValueN-2<nl>
    Value1-M<sep>Value2-M<sep> <sep>ValueN-M<nl>
    All the variable names are listed on the first line, in the order that the values are given in subsequent lines. Each subsequent line represents one data set, with the values for each variable given.
    External Text File Syntax Elements
    <sep>
    Either a comma-separated (CSV) or a tab (tab-delimited) file that separates each variable name or value.
    <nl>
    A newline that ends each data set and can be a line feed, carriage return, or both.
    "true" and "false"
    Allowed values for a visibility variable.
    Spaces
    Around the delimiter are removed when parsing the file; between words in a value string (e.g., two of a kind) are maintained and leading and trailing spaces are maintained if enclosed in double quotes (e.g. , "one kind ").
    Double quotes
    Can be part of a value if preceded by another double quote (e.g. , ""B"" would be "B" in the data set).
    If <sep> or <nl> is part of the variable value, then the entire value must be enclosed in double quotes.
    All variables defined in the PSD document must be defined in the text file. An error will be displayed if the number of variables in the text file does not match the document.
Example data set:
    Using a template for flowers that holds variables for tulip and sunflower, you can set up a text file that looks like this:
    {contents of FlowerShow.txt}
    Variable1, Variable2, Variable3
    true, TULIP, c:\My Documents\tulip.jpg
    false, SUNFLOWER, c:\MyDocuments\sunflower.jpg
    false, CALLA LILY, c:\My Documents\calla.jpg
    true, VIOLET, c:\My Documents\violet.jpg
To import a data set:
  1. Do one of the following
    • Choose File > Import > Variable Data Sets.
    • Choose Image > Variables > Data Sets.
  2. Click the Import button.
  3. Enter the name of the text file to import.
  4. Set up your import options. There is a check box to use the first column value as the data set name. This is useful if your first variable is an identifier like a name or product number and you want to name your data sets with that value. Otherwise, the data sets are named "Data Set 1, Data Set 2, etc.." There is also a check box to delete all current data sets before importing new data sets.
  5. Set the encoding of the text file or leave as "Automatic."
  6. Click OK.

Processing all data sets

    Once you have variables and one or more data sets defined, you can output, in batch mode, images using the data set values. You can output images as PSD files, optimized images, or SWF images.
To process data sets:
  1. Choose File > Export > Data Sets as Files.
  2. Enter a base name for all files generated. You may create your own file-naming scheme if you want.
  3. Click the Choose button to select a destination directory for your files.
  4. Choose data sets to export.
  5. In the Save As text box, choose an export format and set the format-dependent export parameters.
  6. Click OK.
  7. Note: When exporting to SWF format, you can see multiple images in one HTML file. This is useful for quick visual scans. For instance, you can check if text was truncated, or choose a version from multiple data sets you've exported all to one file.

Saving templates for use with other Adobe products

    You can save a template in PSD format for use with other Adobe products, such as Adobe Graphics Server (available only in English) and Adobe GoLive. For example, a GoLive user can place a PSD template in a page layout, bind its variables to a database using dynamic links, and then use Graphics Server to generate iterations of the artwork. Likewise, a developer working with Graphics Server can bind the variables in the PSD file directly to a database or another data source.
    For more information on using PSD templates to create data-driven graphics, see the Adobe GoLive User Guide, GoLive online Help, and the Adobe Graphics Server Developer Guide.

Previewing data-driven graphics

    Preview Document mode lets you preview how a template will look when it is rendered using different sets of data.
To enable or disable Preview Document mode:
    Do one of the following:
    • Choose Image > Preview Document. A check mark appears next to the command when Preview Document mode is enabled.
    • Click the Preview Document button in the tool box.
To preview data-driven graphics:
  1. Enable Preview Document mode.
  2. In the options bar, choose a data set from the Data Set pop-up menu, click the Previous Data Set button Previous Tile button , or click the Next Data Set button Next button .
  3. The data changes in the document window.

Applying data sets

    You can apply a data set's contents to the base document while leaving all the variables and data sets intact. This changes the look of the PSD document to contain the values of the data set.
    Note: Applying a data set overwrites your original document.
    To apply a data set:
    Do one of the following:
  1. Choose Image > Variables > Data Sets. Select the data set to apply from the list of data sets you've created or imported and click the Apply or OK button.
  2. Choose Image > Apply Data Set. Select the data set to apply from the list of data sets and click OK.

Using data sets

    A data set is a collection of variables and associated data. You can switch between data sets to upload different data into your template. 
    http://graphics88.blogspot.com/
    Assigning data values to variables to create two data sets
To edit the default data set:
  1. Do one of the following:
    • Choose Image > Variables > Data Sets.
    • If the Variables dialog box is open, choose Data Sets from the pop-up menu at the top of the dialog box, or click Next.
    • Choose Variables from the Layers palette menu. Then choose Data Sets from the pop-up menu at the top of the dialog box, or click Next.
    Note: You must define at least one variable before you can edit the default data set.
  2. Select a variable from the Name pop-up menu or the list at the bottom of the dialog box.
  3. Edit the variable data:
    • For Visibility variables Visibility variable, select Visible to show the layer's content or Invisible to hide the layer's content.
    • For Pixel Replacement variables Pixel Replacement variable, click Browse (Windows) or Choose (Mac OS) and select a replacement image file.
    • For Text Replacement variables Text Replacement variable, enter a text string in the Value text box.
  4. Repeat Steps 2 and 3 for every variable in the template.
  5. Click OK, or click Next.
To create a new data set:
  1. Click the New Data Set button New button.
  2. Edit the variable data.
  3. Click OK.
To rename a data set:
    Enter a name in the Data Set text box.
To select a data set:
    Do one of the following:
    • Choose a data set from the Data Set pop-up menu.
    • Click the Previous Data Set button Previous Tile button to select the previous set in the list.
    • Click the Next Data Set button Next button to select the next set in the list.
To change the data in a data set:
  1. Select the data set you want to modify.
  2. Edit the variable data.
  3. Click OK.
To delete a data set:
  1. Select the data set you want to delete.
  2. Click the Trash button Trash button .

Using variables

You use variables to define which elements in a template are dynamic (changeable). A variable's type corresponds to the type of data you want to change in a template. Visibility variables let you show or hide the content of a layer. Pixel Replacement variables let you replace the pixels in the layer with pixels from another image file. Text Replacement variables let you replace a string of text in a type layer.
Note: You can use Photoshop to designate text as a variable for Adobe GoLive, if you put your variable text in the topmost text layer. Otherwise, you can use ImageReady to explicitly denote variables. GoLive recognizes all ImageReady text and visibility variables, but not pixel replacement variables.
http://graphics88.blogspot.com/

Two versions of a Web image based on the same template A. Visibility variable B. Pixel Replacement variable C. Text Replacement variable
To define variables:
  1. In the Layers palette, select a layer for which you want to define variables.
  2. Note: You cannot define variables for the Background layer.
  3. Choose Image > Variables > Define, or choose Variables from the Layers palette menu.
  4. Select one or more types of variables:
    • Visibility to show or hide the content of the layer.
    • Pixel Replacement to replace the pixels in the layer with pixels from another image file.
    Note: You specify the replacement image (as well as the replacement text and visibility states) when you define a data set. (See Using data sets.)
    • Text Replacement to replace a string of text in a type layer.
  5. If desired, enter names for the variables. Variable names must begin with a letter, underscore, or colon and cannot contain spaces or special characters (except for periods, hyphens, underscores, and colons).
  6. For Pixel Replacement variables, click Pixel Replacement Options, and do the following:
    • Choose a method for scaling the replacement image: Fit to scale the image to fit within the bounding box (which may leave parts of the bounding box empty), Fill to scale the image to entirely fill the bounding box (which may cause the image to extend beyond the bounding box), As Is to not scale the image, and Conform to scale the image non-proportionally to fit within the bounding box.
    • Click a handle on the alignment icon Center Point icon to choose an alignment for placing the image inside the bounding box.
    • Select Clip to Bounding Box to clip areas of the image that do not fit within the bounding box. This option is only available when the Fill replacement method or As Is replacement method is selected.
  7. To define variables for an additional layer, choose a layer from the Layer pop-up menu. Repeat Steps 3 through 5.
  8. Click OK.
To rename a variable:
  1. Choose Image > Variables > Define, or choose Variables from the Layers palette menu.
  2. Choose the layer that contains the variable from the Layer pop-up menu.
  3. Enter a name in the Name text box. Variable names must begin with a letter, underscore, or colon and cannot contain spaces or special characters (except for periods, hyphens, underscores, and colons).
  4. Note: If you are using data sets and want to rename a variable globally (in all layers), change the name in the Data Sets section of the Variable dialog box. (See Using data sets.)
To remove variables:
  1. Choose Image > Variables > Define, or choose Variables from the Layers palette menu.
  2. Choose a layer from the Layer pop-up menu.
  3. Deselect one or more variables.
  4. Repeat Steps 2 and 3 to remove variables from additional layers, and then click OK.

About data-driven graphics

Data-driven graphics make it possible to produce multiple versions of an image quickly and accurately. Let's say, for example, that you need to produce 500 different Web banners based on the same template. In the past, you had to manually populate the template with data (images, text, and so on). With data-driven graphics, you can quickly generate Web banners using variables and data sets.
You can turn any image into a template for data-driven graphics by defining variables for layers in the image. In addition, you can create different sets of variable data to view what your template will look like when it is rendered.
Creating different versions of an image using variables A. Source file template B. User defines layers as variables C. Different versions of the image can be created, each with a different variable data set
 

Supported Scripting Languages and Platform Issues

    In Windows, you can use any scripting language that supports OLE automation, such as Visual Basic. In Mac OS, you can use Applescript. These languages are not cross-platform but can control multiple applications such as Adobe Photoshop, Adobe Illustrator, and Microsoft Office.
    You can also use Javascript on either platform. Javascript support lets you write scripts that will run on either Windows or Mac OS but can only control Photoshop. Photoshop includes a script editor and debugger for Javascript, but for other scripting languages you must use external tools to edit and debug the scripts.
    Note: Please refer to the scripting documentation included with your Photoshop application installation: AppleScript Reference Guide.pdf, JavaScript Reference Guide.pdf, Photoshop Scripting Guide.pdf, and VisualBasic Reference Guide.pdf. These guides can be found in Photoshop CS/Scripting Guide.
    If you have further questions about OLE, contact Microsoft Corporation. For questions about AppleScript, see your Mac OS documentation or contact Apple Computer.

External automation

    Photoshop supports some external automation using OLE Automation (Windows) or AppleScript (Mac OS). Using either of these methods lets you start Adobe Photoshop and execute actions externally.
    Using external automation lets you perform such tasks as:
    • Having another scriptable application generate a series of files, and having Photoshop batch-process them.
    • Having Photoshop batch-process files and save them to your Web site.
    • Writing a script that runs an action and then shuts down your computer late at night after you've gone home.