• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

With CS3, some things have changed

Participant ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

Let's use this topic to record changes that are likely to affect a working script. As I did in the CS2 comparable topic, I'll add an index here in the topic title when the list is long enough (and I have the time).
TOPICS
Scripting

Views

27.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

This affects JavaScript users only.

Pages.documentOffset now returns the page index within the document, so the first page now has an offset of zero, not one.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

Dave, for the benfeit of those who haven't yet seen documention for CS3's scripting, it is now posted at http://www.adobe.com/devnet/indesign/ included within the 400 megabyte (!) CS3 SDK, the practical reason being that you can now write scripts almost as powerful as plug-ins. My favorite new features so far: Startup Scripts and Custom Labels! Menus and Event Listeners look very promising, too. And XML Rules for the serious crowd...

[Added by Ole]

Thanks, Gary. Please note! You can get the scripting documentation and example scripts without having to download the entire SDK from:

http://www.adobe.com/products/indesign/xml_scripting.html

Click the (hard to see) Scripting tab to display the scripting info. The page will be updated soon with more information and scripts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

In CS2 and before, the collection of text frames (and text paths) which, threaded together, constituted a story could be referenced by:

Story.textFrames;

in CS3, this returns the collection of textFrames that are inline/anchored to the story. This change brings this terminology into line with other similar constructions, such as Story.rectangles but it breaks any existing scripts that use this to access the threaded frames.

In CS3, you should use:

Story.textContainers;

This returns and array of the text frames and/or text paths that make up the story. Note that it is not a collection, so you can't use everyItem() on the result and neither can you refer to

Story.textContainers[-1];

to get the last frame of the threaded story. Instead, you should use something like:

myStory.textContainers[myStory.textContainers.length -1];

or the equivalent in the scripting language of your choice.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

In CS2, if you select a number of objects in the UI, then app.selection would reflect the order in which the objects had been selected. app.selection[0] would be the last selected object. In CS3 this is no longer the case: the order of the selected objects reflects their order of creation.

Peter

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

someone in Adobe likes to make scripter's life harder ...

what else ?? ;)

robin

--
www.adobescripts.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

Robin,

This topic is locked at the top of the forum and will be there for the next couple of years. Do you really want that comment to be so prominently displayed for all that time?

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

Hi Robin,

Well...we're trying to make it easier, actually. But there are some things we just can't avoid when the underlying architecture changes. Transformations, for example, changed a great deal between CS2 and CS3 because they were completely rewritten. This rewrite brings with it a number of advantages, but it also adds a fair amount of complexity.

In any case, we've still got script versioning, so that you can continue to use the previous version of the object model if that's what you prefer. I hope that you'll find enough good stuff in the CS3 model to make it worth upgrading--grep, events, menu scripting, XML rules, and performance improvements seem like pretty compelling arguments, to me.:-)

Thanks,

Ole

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

> Well...we're trying to make it easier, actually.
> But there are some things we just can't avoid
> when the underlying architecture changes.
> Transformations, for example, changed a great
> deal between CS2 and CS3 because they were
> completely rewritten. This rewrite brings with
> it a number of advantages, but it also adds
> a fair amount of complexity.

I refer to two "news" about what was changed:

1) Dave's info about Story.textContainers isn't collection anymore - WHY ?? why now will be better ?? if this was changed - why all other collections weren't "uncollected", too ;)

2) Peter's info about ordering of selected objects - somebody in Adobe does this intentionally - so obviously he knew what he was doing - but WHY ?? why index of creation will be better than order of selection ?? why creation index wasn't added as one more property ??

maybe all changes - should be discused with scripters and accepted by them ?? ;)

I don't want to be rude - I only want to know - if somebody could say - why there are so big - and controversial - changes ...

Olav - there is no ScriptingReference on Adobe.com, there is no ScriptingReference in SDK CS3 - where/when it will be available, please ...

robin

--
www.adobescripts.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

Hi Robin,

re: "1) Dave's info about Story.textContainers isn't collection anymore - WHY ?? why now will be better ?? if this was changed - why all other collections weren't "uncollected", too."

No, we'd rather have it be a collection--it's just that there wasn't time to make it a collection. We were trying to respond to criticism that Story.TextFrames ought to return the text frames used as anchored/inline frames in the story (to make it consistent with rectangles, etc.). As I recall, we also had to fix a bug regarding the differences between text frames/text paths in a story.

re: "2) Peter's info about ordering of selected objects - somebody in Adobe does this intentionally - so obviously he knew what he was doing - but WHY ?? why index of creation will be better than order of selection ?? why creation index wasn't added as one more property ??"

Again, this wasn't an intentional, designed change. The architecture of selection changed, and scripting simply reflects the underlying order. I agree that it's not ideal! That said, I don't know of too many scripts that rely on the order of selection.

re: scripting reference

There is no plan to create a scripting reference PDF. You use VB--I'd expect you'd use the Object Browser to view objects/properties/methods. In previous versions, we've used the reference to attempt to add/fix information--but, this time, we edited the source to add the information to the objects you see in the Object Browser.

Thanks,

Ole

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

> That said, I don't know of too many scripts
> that rely on the order of selection.

- script to thread separate TextFrames as Story
- script to convert layout to database - user select TextFrame with title and Rectangle (with photo) and next TextFrame with Description ... yes - this could be done by checking of applied Char/Para styles to texts - but selection order is better - and fastest - way ;)
- script to reorder objects - last selected object is "reference point"

robin

--
www.adobescripts.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

This JavaScript line no longer works in CS3:

app.palettesVisible = false;

Does anybody know how to do this in CS3???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

go to http://www.kahrel.plus.com/indesignscripts.html and download "Script dictionary (PDF) CS3"
there is Panels collection - I think it is what you are looking for ;)

robin

--
www.adobescripts.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

Hmmm.

app.panels.everyItem().visible = false;

seems to make all panels hide except the Pages panel -- is that a bug (see PS)? But:

app.panels.everyItem().visible = true;

makes literally every panel visible, not just the active set. Aha, but there is an app.applyWorkspace method. But no Workspace object, so I don't think you can find out what ones are available from a script.

Dave

PS: the second time I tried hiding panels with the above script, the Pages panel went as well, so perhaps not a bug but a transient problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

My plan for this topic has changed. I'm going to let it meander as it will and then in a month or two when we've gathered all the information we can, I'll post a new topic to replace this one, containing just the facts with as little editorial discussion as possible. At that point, I'll release this one to drift down the list and eventually to disappear, just like any other topic.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

Not really a scripting change, but useful for scripters nonetheless:<br />flipping is still done by changing the vertical scale of graphics to a<br />negative value (and rotating if necessary), but as of CS3 this is shown in<br />the UI; CS2 used to just show the absolute value for vertical scale, which<br />could be very confusing.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Denver, June 2007 <a href=http://scriptingmatters.com/aspro>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2007 May 02, 2007

Copy link to clipboard

Copied

t56y5ty

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2007 May 04, 2007

Copy link to clipboard

Copied

In CS2 and before, when you get the width of a merged cell, it actually gives you the width of the first column containing the cell. In CS3, you get the width of the merged cell.

This also affects the height property. I just never felt the urge to try this on a merged cell in CS2 before. You get the height of of the first row in CS2 but the height of the merged cell in CS3.

Note that in CS3, if for some reason you want the width of the first column or the height of the first row of a merged cell, it's easy enough to obtain those values.

For scripting tables, this is a big improvement -- pity my client is still using CS2 though!

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 06, 2007 May 06, 2007

Copy link to clipboard

Copied

CS2's applyStyle() has been split into applyCharacterStyle(stylename) and applyParagraphStyle(stylename, override).

Peter

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2007 May 06, 2007

Copy link to clipboard

Copied

After racking my brains about why a script was failing I discover that:

storyOffset returns a number (character offset in story) in CS2 but returns an insertionPoint in CS3.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 08, 2007 May 08, 2007

Copy link to clipboard

Copied

In CS2, this:<br /><br /> tell document 1<br /> tell parent story of text frame "Table frame"<br /> make table<br /> end tell<br /> end tell<br /><br />would make a table enclosing the contents of the story. In CS3, it makes a<br />table at the beginning of the story (or the end, if you target the contents<br />of a text frame). You need to use "convert to table" instead.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Denver, June 2007 <a href=http://scriptingmatters.com/aspro>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2007 May 25, 2007

Copy link to clipboard

Copied

Hello,

I'm working with VBscript.

Is there a difference between cell.associatedXmlElement in CS2 and CS3?
All my cells in CS2 had an associatedXmlElement.
In CS3, my table has an associatedXmlElement, but all its cells don't (The value is Nothing)
Is this a bug? Is it linked with XML evolution?

Thanks a lot

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2007 Jun 04, 2007

Copy link to clipboard

Copied

I have a question about CS3 and CS2 compatibility:

We've got an application wich works (gets text content and saves new one) with CS2 documents (.indd). We use InDesign Server CS2.

Now we've got to add support of CS3 documents. As I understand, the only way here is to Use InDesign Server CS3. Client InDesign CS3 (seems) opens CS2 documents without problems. Question is: will scripts for InDesign CS3 work correctly with documents created by InDesingn CS2 or are there some issues?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2007 Jun 07, 2007

Copy link to clipboard

Copied

Hello everybody looks like new version of InDesign CS3 provides us new nice bugs, stuff which has been working in the other versions before. I'm using VB script.

If you copy, move or duplicate a group of textframes to another document via scripting the textframe options of the textframes in the group are lost and set back to default, only one textframe is keeping the individual options. You have the same problem if you dont group, but select different textframes at once and then copy.

The second bug is similar, if you have a group of objects containing an image and you set new geometric bounds via scripting the image itself is not moved to the new position, but stays in the old position. If you take the move command (been broken in version CS) it is working.

The last thing, I can't understand why didn't Adobe fix the bug from CS2, that oXMLElement.PageItems.Count always gives back 0, in CS it was working fine.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2007 Jun 07, 2007

Copy link to clipboard

Copied

Hi I just upgraded from InDesign 1.5(! Adobe, it would seem would like to forget that this version ever existed). I have a script written in Visual Basic 6 (! I would like to forget that this version of VB ever existed). How do i convert to CS3. I noticed some reference to versioning. Can I use my 1.5 style script for the time being? Where do I find the dll so I can set the correct 'Reference' in VB6? (I downloaded the software).

A lot of questions, I know, but I basically need to know how to make Scripting w/ VB6 work in InDesign CS3.

Thanks,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines