Archive for the ‘scripting’ Category

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.

Scripts make multiple artboards in Illustrator CS4 even better (Real World Illustrator)

Monday, November 24th, 2008

[Editor's note: Mordy Golding at Real World Illustrator shares two tips for working effectively with Adobe Illustrator CS4's new multiple artboards. One addresses rulers across artboards, the other importing multipage PDFs. Both feature scripts by Shane Stanley, Mac only.]

Republished from Real World Illustrator.

First, while Illustrator does offer multiple artboards within a single document, Illustrator only provides one ruler for an entire document. Meaning that you have a single set of coordinates for the entire canvas, and each artboard in your file shares this. This makes it incredibly difficult to position objects precisely by the numbers when you have multiple artboards in a file. Either you have to continuously reposition the origin point of your ruler (which will also shift the positioning of patterns), or you have to do a whole lot of math. And you know I’m no huge fan of math. What we really need is a set of ruler coordinates for each individual artboard.

Download solution 1 for artboard rulers.

Second, you’d think that with multiple artboards, I should be able to open a multipage PDF document in Illustrator, and have each of the pages turn into artboards. Yes, I know that Illustrator really shouldn’t be used for PDF editing, but in many cases, it’s a great solution for that. Alas, upon opening a multipage PDF file in Illustrator, a dialog box appears asking which single page you’d like to open.

Download solution 2 for importing multipage PDFs.

Continue reading the rest of Mordy’s post at Real World Illustrator . . .

Create Calendars Automatically in Illustrator (Kelso)

Thursday, November 20th, 2008

[Editor’s note: I have updated my Calendar script to version 5 on 17 February 2009. Magicien de calendrier, Kalender-Zauberer, Mago del calendario, 日历巫术师, カレンダーの魔法使い, Чудодей календара.

Get version 5 and read more about the changes and see new templates.

WARNING! The information below is OUT OF DATE! ]

[Editor's note: Revised to add example 2009 Ai CS2 format files for download on 4 Dec. 2008.]

ai cs3 logoI was asked recently if I could automate the creation of calendars in Adobe Illustrator. It turns out there are a couple script for accomplishing this in InDesign (best is from sselberg), but only pre-built templates for Illustrator. If you need a new year, you’d have to search for a new template, which is lame. New script to the rescue! Thanks go to Joyce for this suggestion.

No, the script does not create the above calendar. Check out thumbcalendar.com.

Download version 3 of Calendar Script (33k). You will need version CS3 or CS4 of Illustrator.

Examples below for 2009.
Download Adobe Illustrator CS2 version of 2009 calendar. Use the script to build out the rest of the months.
12-up mini
| January.

To install new scripts you need 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

View video demonstration of script (click to play, 9.3 megs):

There are several sizes of calendars:

  1. Wall calendar, large format boxed dates, 1 month fits on a page, sequential pages.
  2. Page calendar, 12 months fit on a letter sized page.
  3. Mini calendar, 12 months small enough to fit on a business card.
  4. Mini 1 month calendar that fits in a date square in a wall calendar.

Couple problems:

  1. Illustrator lacks tables, so we have to rely on tabs and other text-only options. If you want tables, use the InDesign script mentioned above.
  2. Start week on Monday or Sunday?
  3. Track holidays?
  4. JavaScript doesn’t track leap years for February days in month?!

Objectives:

  1. Create single month, full year, or range of months / years.
  2. Editable text
  3. Stylize via script font family, style, size, etc and change later via character style
  4. Option to put 6th week in 5th week line for wall-calendar style
  5. Multiple size defaults
  6. Multiple size calendars in single Illustrator document
  7. Have a GUI graphic user interface

Future Work:

  1. Use of tab stops. Now you have to redefine the paragraph style for the dayTabs.
  2. Colorize weekends, holidays
  3. Support holidays (absolute and relative)
  4. Moon phase icons?
  5. Draw day grid for wall-calendar size
  6. The • buttons for month and year are not working. They should take you to the current month / year.

A Magic Wand for Selecting Text in Adobe Illustrator (KELSO)

Monday, September 29th, 2008

Warning, contains spoilers for my NACIS Practicle Cartography Day presentation in Missoula, Montana. Countdown: less than 10 days!

I have been developing a plugin / script for Adobe Illustrator to make it easier to select type in Illustrator by  attributes like font family, style, size, and fill color. I hope to release this as a commercial plugin for designers and cartographers first quarter 2009. If you would like to beta test this plugin for me, please send me an email at nathaniel@kelsocartography.com.

What is this tool and why would you use it?

  1. A magic wand for clicking on text and selecting like-styled text
  2. A non-modal eye dropper tool for copying font attributes and pasting them onto other text objects without directly eye dropping (like Freehand’s copy and past attributes).
  3. Menu items for Select > Type > Same font, same style, same size, same font color, overprinting, etc
  4. A pro version of the Find Fonts dialog already in Illustrator that does find / replacing in locked and hidden layers, or only in the active layer, sublayer, or window view.

Developing the plugin has taken a lot longer than I expected to implement all the basic and advanced features but I am now 90% complete with the script version, which is over 8,000 lines of code or a 300 page book! Once I return from vacation in October, I will start working on the plugin version which will entail completely translating the script from JavaScript into C in XCode on the Mac and Visual Studio on the PC.

Turning the script into a plugin will bring several benefits:

  • Speed: much faster execution
  • Work with 1,000s of type objects / characters, not 100s
  • Menu items that can be assigned keyboard shortcuts
  • Can be recorded with Actions for automating routine tasks
  • New tool: magic wand for text and non-modal eyedropper for text font appearances

Example uses:

  • Selection:
    • Find all other type objects with same font – View video
    • Find all other type objects with same type size – View video
    • Find all other type objects with same character fill color
  • Applying / creating character styles:
    • Cartographer: ArcMap text imported to Illustrator >> have plugin apply matching style or create new styles that match each of the implicate styles
    • Designer: Quickly comp out a design and select all matching text with certain font attributes with the new Text magic wand tool and make them styles. Great for deadline projects.
  • Find and Replace fonts on hidden and locked layers

Demonstration videos:

Selecting by Font Color – Basic
Including exactly the same color, pattern, swatch, same color mode, by character and by object.
View video – 7.8 megs

Selecting by Font Color – Advanced
Including selecting type object NOT a color and overprints, replacing with knockout.
View video – 17.2 megs

Changing Alignment and Registration of Type
Includes limiting to just point, area, or line type objects
View video – 11.0 megs

Why Change the Registration for Point Type?
To scale type size when it is registered to a townspot or other graphic element.
View video – 1.1 meg

Finding Scope
Limit your selection to active layer, sublayer, current view, selection, artboard/page, and document.
View video – 20 megs

Finding by Text Content
Find all type that has the “River” or “Road” or “Street” in it and then change those text range’s attributes. Options include Is, Starts, Ends, and more.
View video – 13.5 megs

Replacing by Text Contents
With exact phrase or add to the end or beginning of the matched text.
View video – 9.3 megs

Simplified Interface
This dialog is similar to what’d you see for the planned “magic wand” for type tool settings. Thanks to Tom for this suggestion!
View video
– 7.6 megs

GBIF data heat maps – Heat maps over Google Maps for Flash (Biodivertido)

Wednesday, September 3rd, 2008

[Editor’s note: Fascinating proof-of-concept for how to create and display heat-maps in Google Maps for Flash/Flex AS3 using PHP back-end for calculation and Flash for front-end. More information for using Google Maps in Flash CS3 download and reference and tutorial. Similar to some nifty work Zach Johnson is working up at Universal Mind for spatialkey.com.]

Reprinted from Biodivertido.

Maps like everything else seems to be trendy. And nowadays the sexy thing in mapping is the creation of Heat Maps. The best way to understand what they are is to see them:

You can also take a look at this post from one of my favorite blogs on what is and what is not a heat map.
Well for long time I wanted to give it a try and yesterday I had the time to experiment a bit. The idea was to display GBIF available data as a Heat Map over Google Maps. Here you have an screenshot for Quercus ilex:
And if you want to try for yourself here it is (some usability issue, the search box is on the bottom right corner):
So how does it work? It was actually easier than I expected:
1) Get the data: I am using the so called “Density tables” from GBIF. You can access them through GBIF web services API at http://es.mirror.gbif.org/ws/rest/density . For example in a query like this one for Quercus ilex (of course you need to get the taxonconceptkey from a previous request to the services): 
This works fine but has some problems. The first one is that GBIF goes down almost every evening. Tim can maybe explain why. Thats why I am using the spanish mirror (look at the url) and I recommend you to do the same.
Second problem is the verbosity of the XML schema being used. For downloading the Animalia, well thats the biggest concept you can get probably, the result is 14.1 MB of XML. And thats just to get a list of cellIds (if anybody is interested we can post details about CellIds) with counts on them, exactly an array of 34,871 numbers. Even worst is handling them on a web client like this one, parsing such a huge xml output kills the browser. The GBIF webservices API deserve its own blog post I would say together with Tim.
But what is new is that I have supercow powers on GBIF :D I am working for GBIF right now and have access to a test database. In a testing environment I developed a little server app that publish the same density service but using theAMF protocol. I used AMFPHP for this if anybody is interested. There are two good things about using AMF: The output now is around 150 KB for the same thing and AMF is natively supported by Flash so there is no need to be parsed it goes straight into memory as AS3 Objects.
2) Create a Het Map from the data: Once the data is on the client I make use of a Class from Jordi Boggiano called HeatMap.as that creates Sprites as the result. In my case I decided to create a Spring, think like an Image, of 1 pixel per cellId creating a 360×180 pixel image (cellId is equivalent to a 1 degree box).
3) Overlay the image on Google Maps: When you have the Sprite, or even earlier but thats too many details, what you do is overlaying in Google Maps for Flash using a GroundOverlay object that takes care of the reprojection and adapting it to the map. The GroundOverlay is explained in the doc as a way to overlay images but it accepts actually any Sprite.
Done! (almost)
4) Ok, there are some problems: Yes, it is not perfect, these are the pending issues:
  • The GroundOverlay seems to not be reprojecting correctly the Sprite I generate and in the very north and south everything is not correctly overlayed.
  • The resolution of the Heat Map is a little bit poor, bu actually represent the quality of the data we have. Some interpolation could be done to make it look nicer.
  • The colours of the Heat Map do not fit well with the actual Google Maps layers. When there is small data then you can not see it almost.
I still dont feel confident with the code to release it yet. I hope I can work a little bit more on it so that i can be proud, but if you desperately need it let me know.
Just another notice. Yesterday Universal Mind released a preview of a new product: Spatial Key. I am always impressed with what this people does and follow the blogs from their developers (like this one and this one). They are kind of my RIA and web GIS heroes. The new product they have released actually look very much like what I wanted to do in Biodiversity Atlas for data anlysis. It lets people explore geographically and temporally huge datasets. Tim suggested me to contact them and I will do. Nevertheless it is great to have such a great tool available to get ideas on interaction design. Good job Universal Mind, you really rock.
We want to see your comments!
Update: 
Some people asked for different quality settings on the heat map. I have modified the application so that you get now a set of controls to define different quality and drawing options. By default the app tries to figure out depending on the number of occurrences, but maybe thats not the best, depends on how the data is dsitributed. In a final product I think I would NOT provide this functionality to the user, too much for my taste. You know, less is more.

Google Now Indexes Flash Content

Sunday, July 20th, 2008

flash happyAdobe announced earlier this month that they have teamed up with Google and Yahoo! to enhance search engine indexing of the Flash file format (SWF). The newly published SWF specifications allow the search engines to better capture rich internet application’s changing states where much of the Flash file’s content is revealed as the user interacts with the file, not just the opening screen. Google has already rolled out this feature, Yahoo! will be soon. (Graphic from ArsTechnica. Thanks Gene and Laris!)

From the Adobe press release:

 “Designers and Web developers have long been frustrated that search engines couldn’t better access the information within their content created with Flash technology. It’s great to see Adobe and the search engines working directly together to improve the situation,” said Danny Sullivan, editor-in-chief, SearchEngineLand.com. “The changes should help unlock information that’s previously been ‘invisible’ and will likely result in a better experience for searchers.” 

Read Google’s official blog entry on this new feature.

Now that we’ve launched our Flash indexing algorithm, web designers can expect improved visibility of their published Flash content, and you can expect to see better search results and snippets. There’s more info on the Webmaster Central blog  about the Searchable SWF integration.  

 ArsTechnica has a good read on this announcement as well:

 As anyone who has had the pleasure of doing web design and development through marketing agencies knows, Flash tends to be wildly popular among clients and wildly unpopular among, well, pretty much everyone else. Part of the reason for this is because Flash is so inherently un-Googleable; anything that goes into a Flash-only site is basically invisible to search engines and therefore, the world. That will no longer be the case, however, as Adobe announced today that it has teamed up with Google and Yahoo to make Flash files indexable by search engines 

Google says it’s able to do this by developing an algorithm that “explores Flash files in the same way that a person would,” by clicking buttons and manually going through Flash content. “Our algorithm remembers all of the text that it encounters along the way, and that content is then available to be indexed,” wrote the company. “We can’t tell you all of the proprietary details, but we can tell you that the algorithm’s effectiveness was improved by utilizing Adobe’s new Searchable SWF library.”

Of course, Google (and eventually Yahoo) won’t be able to index everything embedded within a Flash file—at least not yet. Anything that is image-related, including text that is embedded into images, will be invisible to the search engines for the time being. Google also noted that it can’t execute certain JavaScripts that may be embedded into a Flash file, and that while it indexes content that is contained in a separate HTML or XML file, it won’t be counted as part of the content in the Flash file. These are all issues that are being worked on, however, and are likely to change in the future.

New York Times published something on this, too.

Wordle – Beautiful Tag Clouds

Sunday, June 29th, 2008

wordle example 2

From the official website:

Wordle is a toy for generating “word clouds” from text that you provide. The clouds give greater prominence to words that appear more frequently in the source text. You can tweak your clouds with different fonts, layouts, and color schemes. The images you create with Wordle are yours to use however you like. You can print them out, or save them to the Wordle gallery to share with your friends.

[Editor’s note: This awesome tool from Jonathan Feinberg, a researcher at IBM, displays tag clouds the “right” way by packing the words into the interstitial space between tags and rotating tags from the horizontal baseline. Johnathan uses simple bounding box logic to accomplish this. I will look into adding this to my Adobe Illustrator script (and perhaps bound the tags into a user-defined shape like a heart for Valentine’s day).

If you look at the HTML tag cloud that is generated for my blog at the right sidebar you’ll see a bunch of text on the same horizontal baselines. That type of tag cloud wastes a lot of space by not packing the words closer together. If there is a big word with small words on 1 line, there is a lot of wasted white space around the smaller words on that line. Fast but not pretty. And only horizontal. Up until now packed tag clouds have taken tedious hand-placement by an artist.

Now Wordle, a web Java applet will do that for you. The tag clouds can be saved as vector PDF by printing to that format in your web browser. This will generate a vector-outlined version of the tags (outlined fonts, not editable type) and in rich-black RGB color space so make sure to convert and clean-up in CMYK before publishing! There is no restriction on publishing the tag clouds for profit or otherwise. Seen on infosthetics.com.]

A Magic Wand for Selecting Text in Adobe Illustrator

Sunday, June 15th, 2008

find and replace fonts screenshot b8

I’ll be showing off my new script / plugin (here, in beta testing) for Adobe Illustrator this Tuesday in DC at the MiniMax conference (June 17th at 8PM ET) at the Lafayette Room at the Grand Hyatt Hotel in downtown Washington. I hope to release this as a commercial plugin for designers and cartographers this summer.

What is this tool and why would you use it?

  1. A magic wand for clicking on text and selecting like-styled text
  2. A non-modal eye dropper tool for copying font attributes and pasting them onto other text objects without directly eye dropping (like Freehand’s copy and past attributes).
  3. Menu items for Select > Type > Same font, same style, same size, same font color, overprinting, etc
  4. A pro version of the Find Fonts dialog already in Illustrator that does find / replacing in locked and hidden layers.

Example uses:

  • Selection:
    • Find all other type objects with same font
    • Find all other type objects with same type size
    • Find all other type objects with same character fill color
  • Applying / creating character styles:
    • Cartographer: ArcMap text imported to Illustrator >> have plugin apply matching style or create new styles that match each of the implicate styles
    • Designer: Quickly comp out a design and select all matching text with certain font attributes with the new Text magic wand tool and make them styles. Great for deadline projects.
  • Find and Replace fonts on hidden and locked layers

I have some videos that show the tool in action here.

MiniMAX 8 is a series of 15 minute tutorials provided by some of the best experts in the web, print, broadcast and interactive design and development community in the Greater Washington DC and Capitol Region area and across North America. Expect to see sessions on ColdFusion, Flash, After Effects, AIR, Flex, Photoshop, Dreamweaver as well as other Adobe related applications mixed in for good pleasure. Attendance is free but preregistration is required.

Phantasm CS – Script for Exporting Separations to PDF

Monday, May 12th, 2008

phantasm cs logoI programmed up a little script for Nick over at Astute Graphics that works with his Phantasm CS Illustrator plugin.

(From Nick’s site) PhantasmSepsPDF allows users to quickly and easily generate pre-separated PDF files. By using the PDF layers feature, these files allow users of even the free Adobe Acrobat Reader (download here) to view any combination of inks used in a document. There are many options to customize the script (open it with a text editor).

By using this approach, the following benefits may be gained:

  • The script is free and is very simply to operate; a few clicks and you’re there!
  • It is possible to provide customers with artwork where they may view any combination of ink used in the document (separations) without the need for Adobe Acrobat.
  • By default, Adobe Acrobat and the free Reader version do not display overprints correctly. Pre-separated artwork using Phantasm CS Studio removes this issue, ensuring that your customer will see all technical aspects correctly.
  • The output mimics final printed output very well. Transparencies are flattened where necessary, but leaving as many vector objects in-tact as possible, allowing zooming-in on detail.
  • The original artwork is not immediately accessible, further securing your ownership.

Continue reading and download the script . . .

How Tag Clouds Work (indiemaps.com)

Wednesday, May 7th, 2008

Zach Johnson has a good post about how Tag Clouds work from a cartographic perspective on his indiemaps.com blog. While we have been trained to scale objects based on their area, he concludes tag clouds might be best scaled by size (height) alone.

I have done some Illustrator scipting that take into account the ink area and the raw results are unsatisfactory and must be scaled again by the width of the tag character count to still make visual sense. All this work does not significantly change how the tag cloud is read (indeed, it may make it harder) and must be done in a graphics environment like Illustrator or Flash (not simple HTML).

Read Zach’s full post here…

zack johnson tag cloud