Posts Tagged ‘jsx’

Wordalizer tag cloud script for InDesign | A Tribute to Wordle (Indiscripts)

Wednesday, March 24th, 2010

_en_01

[Editor's note: Looks like my earlier post on Wordle helped Marc Atret implement tag clouds (word clouds) in InDesign.]

Republished from Indiscripts.

Wordalizer is a word cloud builder for InDesign CS4. Try now the beta version of this experimental script —inpired by the magnificent Wordle web tool created by Jonathan Feinberg.

I began to work on Wordalizer for InDesign in September 2008! Jonathan Feinberg had just launched its brilliant Wordle Java applet and I was highly impressed by the typographical perfection that Wordle could reach in word clouding. I was naively dreaming to operate the same way from the InDesign DOM! Too much confident in my scripting abilities, I still hadn’t realized how powerful the Feinberg’s core algorithm was, until I found this post on “Kelso’s Corner” blog. Feinberg says: “It’s not quite ‘simple bounding box,’ which wouldn’t permit words inside words, or nestling up to ascenders and descenders. It’s full glyph intersection testing, but with a sprinkle of CS applied to make it work at interactive speeds.”

Yes indeed! The hardest part of the whole challenge is in speeding up hit-tests, and you can’t imagine what this Java performance problem looks like when translated into the InDesign JS context! After remaining at a standstill for a long time, I decided to start my script from the beginning again.

Continue reading at Indiscripts . . .

Send Colors from InDesign and Illustrator to Flash (Ajar Productions)

Tuesday, September 1st, 2009

send-script-to-flash_cs4-ai-img

[Editor's note: This handy JSX based script for Illustrator and InDesign from Ajar Productions will transfer spot and process color swatches of all varieties (RGB, CMYK, LAB, HSB) to RGB in Flash using Adobe's built-in color conversion routines to preserve color fidelity. Requires CS3 or CS4 (works best with CS4).]

Republished from Ajar Productions. Dec. 5, 2009

Following the merge text extensions for Flash, Illustrator, and InDesign, Keith Gilbert wrote me wondering about getting swatch information from InDesign to Flash via XFL or by way of importing an Adobe Swatch Exchange (ASE) file into the Flash swatches panel. There are several stumbling blocks in the way of such an extension. First, finding a way for extendscript or JSFL to read the contents of an ASE file (which is not open source and not plaintext) proves to be quite difficult. Second, JSFL (the Flash scripting language) doesn’t have any access (currently) to the swatches panel.


BREAKING NEWS (12/6/08): I noticed that the new Kuler extension for Flash CS4 has an “add to swatches” button, and it actually adds swatches to the swatches panel. After some decompiling and a lot of detective work, I found an undocumented JSFL call that was added to CS4. The feature is undocumented for a reason: it sends encoded XML data, and if the data is faulty, it crashes Flash. I have a few test cases working and I’m confident that I can add it to this extension, so the swatches will go right in the Flash swatches panel, rather than onto the stage, though it will only work in CS4. Be on the lookout for an update in the next few days.

UPDATE (12/7/08): Updated to version 1.1.0. If you have Flash CS4, the swatches will now go right into your Flash Swatches panel. Hooray!

There does seem to be a lot usefulness to such an extension, since XFL creates a new workflow between InDesign and Flash, and the Illustrator importer for Flash is fantastic, but neither one loads any of the swatches from the original document. I’ve certainly spent my fair share of time opening up the swatch properties, making sure the swatch is RGB or hex and copying all three fields one at a time.

So, I decided to plow ahead and see what I could come up with. The results are below. This extension takes the swatches from your current InDesign or Illustrator document and sends them to a new layer on the Flash stage. You can then use the eyedropper to pick up the colors, or you can add them to your swatches panel individually (similar to this demo of the Kuler panel).
UPDATE (12/7/08): If you have Flash CS4, you can skip the step above. Version 1.1.0 of this extension will send the Illustrator or InDesign swatches right to your swatches panel in Flash.

This extension will transfer spot and process colors of all varieties (RGB, CMYK, LAB, HSB). Rather than converting the CMYK with my own function, I used the applications themselves to convert the colors to RGB for Flash, so the transfer fidelity is quite good. It will ignore gradients, tints, patterns and fancy stuff like that. If you want to get your gradients into Flash see the bonus tip below.

Continue reading at Ajar Productions and download files . . .

PatchPanel: Flash Panels for Multiple CS Applications (Adobe)

Thursday, June 18th, 2009

adobedevconnection

[Editor's Note: ]

Republished from Adobe Developer Connection.

By Dr. Woohoo @ blog.drwoohoo.com.

Follow along with this tutorial to expand on what we created in the previous tutorial, PatchPanel: Integrating your ExtendScript, with the objective of using a framework that embraces running our Flash plug-in in multiple Creative Suite applications (Photoshop and Illustrator). When we are done, our Flash plug-in will work in all three CS applications using code that is appropriate for each host application― keeping in mind that this is necessary due to the differences in the DOMs of each application.

Our Flash plug-in will get the RGB values of the foreground color of the host CS4 application. You will integrate a separate ActionScript file for each host application within the Flash plug-in that you develop within a Flex Builder MXML project using the PatchPanel SWC library as the mechanism for communicating between your SWF and the host application, which will dynamically be defined in this example.

After completing this tutorial, you should be able to:

  • Add the Adobe PatchPanel SWC library, cs4.swc, to your Flex Builder Project
  • Import the host CS applications ExtendScript DOM
  • Copy your ExtendScript code from ExtendScript Toolkit to Flex Builder
  • Know what the appropriate color object structure is within the DOM of the three possible host applications
  • Install the SWF and accompanying JSX/JS file so that it is accessible from within Photoshop and Illustrator

Continue reading at Adobe Developer Connection . . .

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.

Illustrator Script: Gimmie an Eye! (Wundes)

Tuesday, February 24th, 2009

John Wundes has a new script for Adobe Illustrator called “Gimmie an Eye!”, useful for the artists among us. It creates eyes with random characteristics for color, shape, and iris. Each eye is grouped, and both eyes are grouped together. No manual settings are available. If you don’t like the output, just make another set until you find something you like. 

Download JSX. View HTML page for script.

To install and use new scripts you have to:

  • Quit Illustrator
  • Copy the files into the Illustrator application folder’s “Presets” » “Scripts” subfolder
  • 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

Announcing Merge Text Extension for Adobe Illustrator (Ajar Productions)

Wednesday, November 26th, 2008

[Editor’s note: Dealing with broken text (common in PDF files) can be dastardly. There are a couple existing scripts out there, but few combine and preserve the font styling information at the same time. This new script does that with options. I’m curious how this new script from Ajar Productions installs into Illustrator using the Adobe Extension Manager, usually just for the old Macromedia products but not in all CS4 apps? The Flash version is also appealing.]

Republished from Ajar Productions. First seen at Mordy’s Real World Illustrator blog.

Following the release of [Ajar's] Combine Textfields extension for Flash, [they] put together a similar extension for Adobe Illustrator. This extension installs a script that will merge text (including text on a path) into one text object, while retaining the style attributes of the individual pieces, including character styles as well as paragraph styles (if the separator includes a return character).

Anyone who’s tried to edit text from a PDF opened in Illustrator knows how frustrating it can be to make simple text edits when the text is broken up. This extension reduces that headache.

Special thanks to David Van Brink for posting the Omino Dialog Maker. His time-saving code was used to produce the dialog box in this extension.

Download Options

Installation Instructions

JSX or JS file:

  1. Place the MergeText_AI.jsx (or MergeText_AI_CS.js) into the Scripts directory within your Illustrator application directory:

Windows > C:\Program Files\Adobe\Adobe Illustrator {version}\Presets\en_US\Scripts
Mac OS X > Applications/Adobe Illustrator {version}/Presets/Scripts

Note: In CS4, the directory path will include a region directory (e.g. Adobe Illustrator CS4/Presets/en_US/Scripts).

MXP file (CS4 only):

  1. Double-click on the mxp file to install using Adobe Extension Manager.

Usage

In Adobe Illustrator, select the text the you want to merge together and go to File > Scripts > MergeText_AI. If you’re using Illustrator CS3 or CS4, you will be prompted with a dialog box where you can choose your sorting orientation and a custom separator. If you’re using a version earlier than CS3, you will not be prompted with a dialog; the script will run using the default settings sorting topmost, then leftmost, with a separator of “[><]“. You can then run a Find and Replace and replace the separator with the characters of your choice.