Posts Tagged ‘cs2’

Script: Place Multiple Files in Illustrator (Kelso)

Tuesday, March 10th, 2009

[Editor's note: This new script allows multiple files to be placed into Adobe Illustrator at once. Illustrator's native place command can only handle 1 single file at once. This script was commissioned by Eric at Nutshell Communications, Inc.]

This script will allow you to (import) place multiple files as separate named layers from a designated folder to a new Illustrator document. The files are all placed at once, you don’t get to control individual placement (but of course you can modify location after the script runs). Script should work with CS2, CS3, and CS4, both Mac and Windows.

To install new scripts you need to:

  • Download either the IMAGES version (eg, JPG, GIF, TIF, etc) or the EPS version.
  • Quit Illustrator
  • Copy the script file into the Illustrator application folder’s “Presets” » “Scripts” subfolder. If you are in CS4 this will be the application folder’s “Presets” » “en_US” » “Scripts” subfolder (transpose “en_US” with your local language string).
  • After restarting Illustrator, you can find the scripts in the menu “File” » “Scripts”;
  • TIP: You can create subfolders in the scripts folder to organize your scripts

Usage

  • The script asks for a folder to be selected by the user in a normal file open dialog.
  • All loose files are examined and if they match EPS file type then they are placed (nested folders not examined).
  • It is easy to limit this to EPS or add other file types (see below)
  • The files are placed into the middle of the document (or registered to a 9-point page location).
  • Each placed file gets its own layer, the layer name matches the placed file’s name.
  • The file is not auto-saved. You do that manually.

Placement Options

Line 7 controls the placement of the imagesinto the document. These are 9-point registration of ul, ml, ll, um, mm, lm, ur, mr, lr.
var placement9pointAlignment = “mm”;

Adding More File Types

Line 33 controls which file extensions are supported:
if( (fName.indexOf(“.eps”) == -1) ) {

You can easily expand the file types supported as shown in the commented out line in 34:
//if( (fName.indexOf(“.eps”) == -1) && (fName.indexOf(“.gif”) == -1) && (fName.indexOf(“.jpg”) == -1) && (fName.indexOf(“.png”) == -1) && (fName.indexOf(“.bmp”) == -1) && (fName.indexOf(“.tif”) == -1) && (fName.indexOf(“.psd”) == -1)) {

To allow more file types, use the formatting and grammar as in line 34.

How to Script in Adobe Illustrator (Adobe)

Wednesday, January 7th, 2009

[Editor’s note: I get asked frequently how to get into automating Illustrator via scripting. My favorite language is JavaScript (it’s cross platform) but there is also AppleScript (Mac) and Visual Basic (PC). A listing of all my scripts is here, including my recent script for creating calendars. Adobe does a good job of getting you started with several introductory and intermediate manuals. Plus they even offer a free toolkit application for writing the JavaScripts. The new scripting guides for CS4 are up on Adobe’s site, including how to use Flash panel inside Illustrator to make more interesting graphical user interfaces (or hit testing). There’s new information on using TabStops in there over CS3 and documentation on how to script the new Artboards feature. Give it a try!]

Republished from Adobe.com.

ADOBE ILLUSTRATOR CS4 SCRIPTING

A script is a series of commands that tells Illustrator to perform one or more tasks. Adobe Illustrator CS4 supports scripts written in AppleScript, JavaScript or VBScript. Sample scripts are included in the Adobe Illustrator CS4 installer and get installed with the product. The latest available scripting documentation is provided below:

SAMPLES

Adobe Illustrator CS3 FlashPanel Sample

The FlashPanel sample for Adobe Illustrator CS3 shows how to script Illustrator from Flash using ScriptUI’s FlashPlayer control. The sample illustrates how rich user interfaces created by Flash authoring tools such as Adobe Flex Builder 2 can interact with Illustrator’s scripting object model.