Tuesday, April 24, 2007

 

CS3 is Here!

The new scripting features in CS3 are both awesome and somewhat intimidating. All the new features of InDesign CS3 are supported and there are new scripting-specific enhancements that most non-scripting users will never notice. The most immediate issue faced by anybody who has accumulated a collection of scripts is compatibility -- will the existing scripts still run?

The answer is mostly.

First, there's the versioning feature. Put your CS2 scripts in a folder named Version 4.0 Scripts and they'll run as though the application is still InDesign CS2. Although there are some subtle changes that might affect some scripts. For example, CS2 always delivered the members of the selection (when more than one item was selected) in a reliable order. CS3 does not, even with versioning switched on. Frankly, I would never have known that had it not been for Pete Kahrel who has written some CS2 scripts that took advantage of that ordering. So far, among my own scripts, I've yet to discover one that won't work with versioning on, except for those scripts that explicitly check the application's version (which returns 5.0.0.nnn, where nnn is the build number) even with versioning on.

What about converting scripts. How many need converting? Quite a few.

Any script that uses Find/Change of text is going to have to be revised to use the new structure. This part of InDesign's scripting system is tightly bound to the user interface feature and even a cursory glance at the new Find/Change dialog tells you that a lot has happened here.

Any script that depends on the Story.textFrames collection to manage the text frames (and paths) that constitute a story will instead need to work with the textContainers property, which (unfortunately) is not a collection but an array. Story.textFrames is still a collection, but now it is the collection of inline/anchored text frames inside a story. FWIW, I've already written one script that was able to take great advantage of this:
//DESCRIPTION: Fix overset anchored text frames

if (app.documents.length == 0) { exit() }
app.documents[0].stories.everyItem().textFrames.everyItem().fit(FitOptions.frameToContent);
This script came in very handy for eliminating the overset condition of all my anchored figure/caption text frames when I increased the space between the figures and their captions by changing the space before of the caption paragraph style.

Scripts that transform objects have a whole new way of working that I have yet to investigate.

Scripts that interact with paragraph, character and object styles now have to deal with grouping of styles. This is more a philosophical issue than a technical one. The chances are that existing scripts will still run, but they might not do what the user really wanted if he has organized his styles into group hierarchies.

What's New?

First and foremost for JavaScripters, ExtendScript Toolkit 2 is introduced. It represents a major facelift over its predecessor and it includes object model viewers (OMV) accessed through the Help menu that eliminate the need for those horrendously large reference PDFs. Indeed, InDesign CS3's scripting documentation consists of a Guide and Tutorials (one for each scripting language) with the reference available only through the OMV.

Support is added for Script UI, the scriptable interface system that was previously available with Bridge.

Scripts can now interact with and add items to the menu system and they can respond to certain system events. Indeed, if you explore the product you'll discover that the File/CrossMedia Export features have been added by scripts.

JavaScripts can now be saved as binary files.

I have the distinct impression that I'm selling the new features short here, but "real work" beckons, so I'll be back with more when time allows.

Comments:
Can you give me a clue as to how I can apply a style to the following code which inserts a unicode character -- one of the "set" symbols. I want to designate this a being in the Symbol character style and I'm not there yet.
 
Can you give me a clue as to how I can apply a style to the following code which inserts a unicode character -- one of the "set" symbols. I want to designate this a being in the Symbol character style and I'm not there yet.
 
Dave. Can you explain in more detail the difference between a collection, and an array?
Roy
 
Do you know how to convert the CS2 script "shopPDFoptions" so that I can use it in CS3 ?
 
Did I write the shopPDFoptions script? I don't recognize the name. Have you tried creating a folder called "Version 4.0 Scripts" and running it from there?
 
don't know where I got this "showpdfoptions.js" script from.
was a download, but I can't find it anymore

it does not work when I put it in a folder you mentioned.

if you can help, please do.
 
By all means contact me directly and I'll be happy to give you a quote for doing the job. I need more information than you have so far shared.

Sight unseen, I'd estimate a price of $160 to do this job, but I'd need to see the existing script to confirm that estimate.

Maybe it's a CS script (the .js extension suggests that). Try it in a folder named: "Version 3.0 Scripts" that might just work.
 
how do I contact directly ?
 
Use the email link in my profile. Sorry, I should have activated that yesterday. If I suddenly get a lot of spam, I'll deactivate it again.
 
In 2004 we were looking at Adobe InDesign and found that by placing content from Word docs containing MathType equations, they overlapped type. Also, converting Pagemaker files with graphics, the graphics overlapped type. You had written a script to fix those probs. We're going to purchase CS3. Will I still need that script? If so, where can I get it (lost it when Adobe InDesign 1 was removed), and will it work with CS3? Thanks. Linda
 
Linda,

CS3 has a far improved support for this thanks to anchored objects. I'm not sure that a script is even needed any more.

The script I wrote for CS1 did horrible things to the leading of text in the vicinity of the equation. With CS3, you can apply an object style to the equations to give them a text wrap to push the next line down (using Jump Object text wrap, if memory serves) combined with a yOffset for the anchored object to move the baseline down.

Dave
 
Hello Dave,

After reading some of your blog articles on Indesign CS3 Scripting. I am very impressed with your Indesign scripting knowledge. I'm currently working on a phone directory project with Indseign CS3 using the XML import function. I nearly have the project completed; one last issue that I have encountered is the vertical column alignment of the XML records. I have an XML layout that is cloned through the Indesign CS3 import options. The XML layout ends with the Address XML tag. That is were I’m have the issue, I can’t get the record to align vertically at the bottom of the columns. I want the Address XML tag to be the last line on each column. I know that Indesign CS3 knows to clone each record meaning that when it’s cloning the records, there is a starting and ending point for each record before it inserts the next record.
 
Anonymous,

I recommend you post your question in the Adobe U2U InDesign Forum. I've done very little with importing XML I'm afraid.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?