Skip navigation
Currently Being Moderated

With CS2, some things have changed

Apr 25, 2005 12:35 PM

I have not located a place where changes in scripting between CS and CS2 are reported, so I thought I'd start a topic here with some of the things I know about.

This is about changes to the object model that are not related to changes in the functionality that have taken place.


1. User Interaction Control
2. Table Labels
3. Parent Text Frame
4. New Beep Function
5. Find/Change symbol for End Nested Style Here
6. Convert to Table
7. Active Script in doScript
8. Text selections more specific

9. Table selections
10. Indexes
11. Basic Paragraph style
12. Enumeration Name Changes
13. Placed Assets
14. Previous Text Frame
15. Version Property
16. Add Page Reference (Index)


In describing these in the following messages, I'll use JavaScript terminology, but most of these issues are independent of the language.
 
Replies 1 2 Previous Next
  • Currently Being Moderated
    Apr 25, 2005 10:26 PM   in reply to (Dave_Saunders)
    Hi Dave--

    Regarding your doScript example--you haven't given it a file to run, you've given it a string. I'm not sure what you mean by "the fundamentally different manner in which scripts are run with CS2"--I don't see it. If doScript for a string returned a file for a string being run using doScript in CS, then it was an error.

    In addition, if you use doScript to run a script file, then app.activeScript should return the name of that file, not the name of the script in which the doScript statement is used.

    Thanks,

    Ole
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2005 11:06 PM   in reply to (Dave_Saunders)
    Hi Dave--

    Regarding the end nested style metacharacter--this is also true in the user interface, so it's not only a scripting change (and, for that matter, we have no control over it). While I disagree with the UI team changing find/change metacharacters without notice, I do check the metacharacters list with each new release, just in case.

    Thanks,

    Ole
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2005 10:06 AM   in reply to (Dave_Saunders)
    Hi,
    In CS the Unicode "\u0016"= Table.
    Has been changed in CS2?

    Thanks.

    jxswm
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2005 12:25 PM   in reply to (Dave_Saunders)
    In ID 2.0.2 - was't the same ??

    robin
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2005 8:28 PM   in reply to (Dave_Saunders)
    > don't know -- but I'd advise against using unicode values to identify tables. Doing that kind of thing falls into the category of reverse engineering, it seems to me, and is not something that can necessarily be relied upon from one release to the next.

    Very true. Relying on undocumented features is a good way to have your scripts break with the next release.

    However, since Adobe has no compunction about breaking documented behavior with a new release, it doesn't make much difference, does it?
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2005 3:28 PM   in reply to (Dave_Saunders)
    Indexes

    Scripting indexes has changed a lot. It finally works, and it works well. The property 'subtopic' has gone, instead you iterate the property 'topic' (up to three times). The following lines illustrate:

    if( app.activeDocument.indexes.length == 0 )
    myIndex = app.activeDocument.indexes.add()
    else
    myIndex = app.activeDocument.indexes[0]

    //create main topic
    myIndex.topics.add('dog')
    //create subtopics
    myIndex.topics.item('dog').topics.add('collie')
    myIndex.topics.item('dog').topics.add('setter')
    myIndex.topics.item('dog').topics.item('collie').topics.add('border collie')
    myIndex.topics.item('dog').topics.item('collie').topics.item('border collie').topics.add('*****')

    You can address (sub)topics by asking for topics embedded under topics:

    myIndex.topics[0].topics[0].topics[0].topics[0].name

    is the first subtopic of the first subtopic of the first subtopic of the first topic.

    A new property is allTopics: myIndex.allTopics returns an array of all (sub)topics. This is a flat, one-dimensional, array, i.e. it returns the whole index but without structure.
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2005 4:58 PM   in reply to (Dave_Saunders)
    Peter--

    Glad you noticed that we fixed indexing! I'd actually somewhat forgotten about it, as it's not a new feature--we just made it work the way it was always supposed to work. (It was originally implemented by WinSoft in France--between their English and my French, some things were lost in translation.)

    There's still a lot to do, and there are still some bugs to fix--I'd urge you not to change the sort order for an existing index topic using scripting, as it's pretty fragile. But it's much better--for scripting and for saving to .inx.

    I like adding the "flattened" collections--such as allTopics--wherever we can (to avoid having to use iteration/recursion to find things), so it made sense to take care of it while we were working on the plug-in.

    Thanks,

    Ole
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2005 5:16 PM   in reply to (Dave_Saunders)
    //----------------------------------------
    A new property is allTopics: myIndex.allTopics returns an array of all (sub)topics. This is a flat, one-dimensional, array, i.e. it returns the whole index but without structure.
    //----------------------------------------
    In CS:
    allTopics = myIndex.topics.everyItem().subtopics.everyItem();

    But if change the topics's one subTopic's sortOrder, the subTopic's index has been changed, it means:
    the before subTopic[x] != after subTopic[x];
    I have spent so much time to solve the problem.
    Is not the same as the in CS2?

    jxswm

    jxswm
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2005 8:51 PM   in reply to (Olav_Kvern)
    Hey, wait - "sort order" ?<br /><br />Does it do what one would think it does? I.e. change sort order to that of<br />different alphabets such as German, English, Norwegian etc?<br /><br />Where is that located in the UI? I can't find it<br /><br /><br /><br />On 05-04-28 02.58, in article 3bba0c2a.19@webx.la2eafNXanI,<br />"Olav_Kvern@adobeforums.com" <Olav_Kvern@adobeforums.com> wrote:<br /><br />> There's still a lot to do, and there are still some bugs to fix--I'd urge you<br />> not to change the sort order for an existing index topic using scripting, as<br />> it's pretty fragile. But it's much better--for scripting and for saving to<br />> .inx.
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2005 12:10 AM   in reply to (Dave_Saunders)
    Richard,

    Sort order is here the 'Sort By' panel in the Topic Options dialog, used to set the sort order of individual entries. Sort order for particular languages is still sadly missing.

    jxswm,

    I don't know if it's fixed in CS2, but as Ole mentioned that it's still fragile in CS2, you'd better hang on to your solution.

    Peter
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2005 1:45 AM   in reply to (Dave_Saunders)
    Yes!

    The problems in index CJK language Sorting:

    b Common problems:
    <1>. Simple Chinese(Chs): Phonetic--Stroke sorting can be not identifed automately;
    <2>. Traditional Chinese(BIG5): Stroke sorting can be not identifed automately;
    <3>. Korean can not be sorting by KS Code automately;

    So: I using IndexSort Plug-In or Script to sort by:
    (1). Chines Simplified(GBK) Phonetic;
    (2). Chines Simplified(GBK) Stroke;
    (3). Chines Traditional(BIG5) Stroke;
    (4). Hangul(Korea)(KS Code);
    (5). ACII

    In '(5). ACII' Can change sort order to that of
    different alphabets such as German, English, Norwegian etc?

    //-----------------------------------------------
    My meaning is: In CS2 is there a way to sort the order autoly, because I must to run the Plug-In or Script by hand now.

    Thanks.

    jxwswm

    > http://websamba.com/IDscript/



     
    |
    Mark as:
  • Currently Being Moderated
    May 5, 2005 2:53 AM   in reply to (Dave_Saunders)
    Can we have this what's changed information for AppleScripter also?

    TIA
     
    |
    Mark as:
  • Currently Being Moderated
    May 13, 2005 3:56 AM   in reply to (Dave_Saunders)
    Previous text frame

    Another difference. Suppose you want to link a textframe between two others. In CS you do

    frame1.previousTextFrame = frame2.previousTextFrame;
    frame2.previousTextFrame = frame1;

    This gives an error in CS2, because frame2.previousTextFrame is already frame1, as this confirms:

    frame1.previousTextFrame = frame2.previousTextFrame;
    if (frame2.previousTextFrame != frame1){
    frame2.previousTextFrame = frame1;
    }

    Teus de Jong
     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2005 9:52 AM   in reply to (Dave_Saunders)
    Yikes, I was under the impression that there wouldn't be that many changes but there sure are. I've identified 3412 (!) differences so far, by comparing the scripting libs of CS and CS2 via reflection. This excludes all new types, such as ObjectStyle.

    One very, very bad thing is that the scripting lib is now even less (by magnitudes) typesafe than it was before, making typesafe scripting in .NET a PITA.

    Not very inspiring....
     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2005 12:21 PM   in reply to (Dave_Saunders)
    E Gunnar Liljas wrote: "Yikes, I was under the impression that there wouldn't be that many changes but there sure are. I've identified 3412 (!) differences so far, by comparing the scripting libs of CS and CS2 via reflection. This excludes all new types, such as ObjectStyle."

    Again, you can use script versioning to run CS (3.x) version scripts in CS2 (4.x)--see Olav Kvern, "InDesign CS2 Script Versioning" #7, 27 Apr 2005 12:25 pm

    Thanks,

    Ole
     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2005 10:59 PM   in reply to (Dave_Saunders)
    Unfortunately that is not an option when working from .NET
     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2005 12:13 AM   in reply to (Dave_Saunders)
    Hi E Gunnar Lijas--

    You should be able to use the CS (3.x) version of the scripting model with VB.NET, as described in the earlier post (publish the terms, then add the reference to your VB.NET project). If that doesn't work, you can alway send a string as VBScript and target the 3.x version of the model.

    Thanks,

    Ole
     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2005 4:11 AM   in reply to (Dave_Saunders)
    OK, that seems to work. However, there still exist a few changes, especially for the ChangePreferences and FindPreferences, where all properties are of type "object" now. They used to be strongly typed.

    Is this change done in order to make it possible to unset the properties of ChangePreferences and FindPreferences, by using null/Nothing, or it it something else?
     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2005 9:38 AM   in reply to (Dave_Saunders)
    Hi E Gunnar Liljas wrote: "Is this change done in order to make it possible to unset the properties of ChangePreferences and FindPreferences, by using null/Nothing"

    Yes. (It was possible in CS, as well.)

    Thanks,

    Ole
     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2005 11:43 PM   in reply to (Dave_Saunders)
    It was possible in weakly typed environments, but not in C# et. al.
     
    |
    Mark as:
1 2 Previous Next
Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)