• 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

28.5K

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 ,
Feb 28, 2008 Feb 28, 2008

Copy link to clipboard

Copied

I've been using .search() for a lot of our catalog caption generation and this seems to have changed or have been removed in CS3? (I can't find the JS reference that existed for CS2 in a CS3 version... any pointers there? The documents on the Adobe site seem to be more tutorial style than references).

The code below uses a placed group of textframes from the library, places them, and then puts the text where the placeholders are. Any idea why .search() is no longer a function of parentStory?

captionPlaced.textFrames[0].parentStory.search(
'**LOT**',
false,
false,
itemData['Lot_Number'],
{},
{'appliedParagraphStyle':'Lot Number'}
);

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 ,
Feb 28, 2008 Feb 28, 2008

Copy link to clipboard

Copied

That's a well-known change from CS2 to '3.

The old search has been replaced with the triplet findText, findGrep, and findGlyph. These return an array of found items jsut as search did. They don't do the replacement anymore (thanks for that!), you've got real changeText, changeGrep, and changeGlyph methods now.

Check any text related property in the ESTK2 Help
  • -- Story, Text, Paragraph, Word -- there it is.

  • The ID CS3 Model help is lurking in the Help menu there. Browse this forum for more info on that.
  • 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 ,
    Feb 28, 2008 Feb 28, 2008

    Copy link to clipboard

    Copied

    thanks jongware! i think this shows that either me or adobeforums.com suck at searching.

    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 ,
    Feb 28, 2008 Feb 28, 2008

    Copy link to clipboard

    Copied

    If you dislike the ESTK help browser -- people do, apparently 😉 -- try this: http://www.jongware.binaries.indesigncs3jshelp.zip

    It's a hyperlinked set of HTML, the product of my own homegrown XSLT, let loose on the full XML help (which should be somewhere on your hard disk).

    For a full description and some of the limitations, and some praise as well, see the full thread here: http://www.adobeforums.com/webx?7@@.3bbf275d.3bc44040/12

    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
    Guru ,
    Mar 12, 2008 Mar 12, 2008

    Copy link to clipboard

    Copied

    I just got an email from a student who complains that the keyboard shortcut to open/close the Tabs panel no longer closes the panel. (A change in behavior from CS2 to CS3.)

    Setting up a new keyboard shortcut for the Tabs panel command does not help.

    I would like to offer the option to my student to use a script to open or close the Tabs panel. But I haven't a clue as to how to write such a thing.

    I doubt it is too complicated, and should be helpful for others.

    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 ,
    Mar 12, 2008 Mar 12, 2008

    Copy link to clipboard

    Copied

    Sandee,

    Scripts can't open and close panels in the UI. But you can use the Esc key to close the Tab panel.

    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
    Guru ,
    Mar 12, 2008 Mar 12, 2008

    Copy link to clipboard

    Copied

    Duhhhhh, how obvious!

    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 ,
    Mar 12, 2008 Mar 12, 2008

    Copy link to clipboard

    Copied

    On 13/3/08 3:19 AM, "Peter Kahrel" <member@adobeforums.com> wrote:<br /><br />> Scripts can't open and close panels in the UI.<br /><br />How about toggling their visible property? Of course it's academic here,<br />because (a) you've given a better solution, and (b) the tabs dialog isn't a<br />panel.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>

    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 ,
    Mar 12, 2008 Mar 12, 2008

    Copy link to clipboard

    Copied

    >How about toggling their visible property?

    Right -- hadn't thought about that. Bit of a rash overgeneralisation that the UI isn't available to scripts, which obviously is nonsense given that you can add and remove menu items and toggle panels.

    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 ,
    Apr 17, 2008 Apr 17, 2008

    Copy link to clipboard

    Copied

    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 ,
    Apr 22, 2008 Apr 22, 2008

    Copy link to clipboard

    Copied

    Hello All,

    I want to create 100 Pages in the template using Master A. Right now i am doing manually to create 100 Pages and linking manually. I want to do this in a automized way.

    What is the better way to do this. May be via script or via Manullay with single button like that i don't want to do each and every page manually.

    Can any body thru something about this and suggest me to do this.

    Thanks in advance
    Selva

    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 20, 2008 May 20, 2008

    Copy link to clipboard

    Copied

    this code works in CS2 but i doesn't work in cs3 if the insertion point of the frame is overset.

    --You must have selected a text frame with text inside it
    tell application "Adobe InDesign CS2"
    tell active document
    set frame to object reference of selection
    set insertion_point to object reference of end of last paragraph of parent story of frame
    tell insertion_point
    make text frame with properties {contents:"Inline text frame", geometric bounds:{"0mm", "0mm", "25mm", "41mm"}}
    end tell
    end tell
    end tell

    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 ,
    Aug 06, 2008 Aug 06, 2008

    Copy link to clipboard

    Copied

    I am a first day newb to scripting. I need to simply use find/change to delete several instances of text and in one case replace text with a tab. I wan't these to run concurrently. I can't seem to get the findchangelist script to even run after editing the FindChangeList.txt file. I'm using the script that shipped with the application. where can I find a simple tutorial in kindergarten english on the subject?

    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 ,
    Aug 06, 2008 Aug 06, 2008

    Copy link to clipboard

    Copied

    Hi SethMcGraw,

    There's a chapter in the Scripting Guide on text and type that includes several find/change examples. The corresponding scripts are available in the Zip archive containing all of the Scripting Guide scripts. Both are available at the InDesign scripting home page--you'll find a link at the top of the forum.

    There's also a new version of FindChangeByList available at the same link.

    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
    New Here ,
    Sep 18, 2008 Sep 18, 2008

    Copy link to clipboard

    Copied

    how to convert bottom statement from cs2 to sc3

    phcode.Rotate (deg)

    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 ,
    Sep 28, 2008 Sep 28, 2008

    Copy link to clipboard

    Copied

    Hello, I am currently studying InDesign CS3 at Conestoga College in Waterloo, Ontario. I want to congratulate Olav Kvern and Dave Blatner on their Real World InDesign text. It is very well done, and I welcome the many humorous asides. A point of interest: Ken Graham, a professor at the University of Guelph, is a leading authority on William Beckford and is working on a scholarly edition of 'Vathek' and the 'Episodes of Vathek'. My interest in InDesign centers on its usefulness in setting mathematical articles via the InMath plugin. The javascript and XML support looks good too.

    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 ,
    Jan 07, 2009 Jan 07, 2009

    Copy link to clipboard

    Copied

    So, we're a little behind...we're just moving from CS2 to CS3. So please bear with me. (We're using Javascipt)

    Until I'm able to convert all of our scripts to CS3 compatibility, I created a "Version 4.0" folder in the scripts panel, hoping I can use our CS2 scripts as-is.

    One of my CS2 scripts places a snippet on the master pages. Before, it would place by itself with no questions asked. In CS3, the snippet is a loaded cursor wanting me to click to place it. What do I need to change? This is the section of the script

    //Place Master Page items
    myDocument.masterSpreads.item("A-Master").place(
    mcmMasterPage, //the document
    [0,0], //top-left coordinate of text frame
    undefined, //layer
    false, //show options
    false ) //autoflow

    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
    Enthusiast ,
    Jan 19, 2010 Jan 19, 2010

    Copy link to clipboard

    Copied

    Trying to update some scripts and I found a few things I don't recall reading in this thread:

    1. Trying to create xmlTag that already exists raises error in CS3

    In CS3 (and CS4) you get an error trying to create xml tags that already exist:

    myDocument.xmlTags.add(sTag)
    Error: A tag with that name already exists.  Please choose a different name.

    (while in CS2 the same code just returned the existing tag without an error)

    2. Several parents and markupTags for an xmlElement

    xmlElement can have several parents. The parent propery is then returned as an array. The same goes for tags.

    Having more than one element with the same name, and assuming that there is only one by using myElement.item(the duplicate name here) you seem to get a single xmlElement but it has for example several markupTags (markupTag can be an array in CS3 and later).

    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 ,
    Jan 22, 2010 Jan 22, 2010

    Copy link to clipboard

    Copied

    Andreas Jansson wrote:

    Trying to update some scripts and I found a few things I don't recall reading in this thread:

    1. Trying to create xmlTag that already exists raises error in CS3

    In CS3 (and CS4) you get an error trying to create xml tags that already exist:

    myDocument.xmlTags.add(sTag)
    Error: A tag with that name already exists.  Please choose a different name.

    (while in CS2 the same code just returned the existing tag without an error)

    Don't "add" tag - just use it in taggin process:

        With myXMLelem.XMLElements.Add("character")
            Call .XMLAttributes.Add("type", "text")
            .Contents = "empty paragraph" & vbCr
            Call .XMLAttributes.Add("aid:cstyle", .Texts.Item(1).AppliedCharacterStyle.Name)
        End With

    or

        With myTSRangeText.AssociatedXMLElements.Item(1).Parent.XMLElements.Add("character")

            Call .Markup(myTSRangeText)

            Call .XMLAttributes.Add("type", "text")

            Call .XMLAttributes.Add("aid:cstyle", myTSRangeText.AppliedCharacterStyle.Name)

            If .Parent.MarkupTag = "character" Then

                Call .Move(idLocationOptions.idAfter, .Parent)

            End If

        End With

    2. Several parents and markupTags for an xmlElement

    xmlElement can have several parents. The parent propery is then returned as an array. The same goes for tags.

    Having more than one element with the same name, and assuming that there is only one by using myElement.item(the duplicate name here) you seem to get a single xmlElement but it has for example several markupTags (markupTag can be an array in CS3 and later).

    Few .parents ? Or you are talking about .AssociatedXMLElements collection for Text object ?

    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
    Enthusiast ,
    Jan 25, 2010 Jan 25, 2010

    Copy link to clipboard

    Copied

    LATEST

    No 1. I might want to create tags (in the tags palette), first, for one reason or another 🙂

    That is, not in the immediate tagging process.

    No matter the reason: there is an add method on the tags collection, and as I see it, it was changed ... and this is the place to record it.

    No 2 is about having a reference to an xmlElement object in the structure (XML tree).

    Also, I forgot to mention that I'm using javascript, so there might be differences in how the objects are returned.

    To illustrate, here is a piece of my code. I have a reference to an xmlElement object in the tree. Let's call it elemToFind:

        if(elemToFind.index.length>1){
             // If elemToFind is not a single object, get its FIRST parent using [0], and go down again to get a SINGLE instance of the object instead.
            elemToFind = elemToFind.parent[0].xmlElements.item(elemToFind.index[0]);
            alertAndLog('The XML element "' + elemToFind.markupTag.name + '" exists more than once, under the same node.');
        }

    The elemToFind was set (as I wrote in the previous message) using the item() method of its parent.

    If the XML structure looks like this:

    Root

      Sibling1

      Sibling2

      Sibling2

      Sibling3

    ... then I experienced this problem when setting a reference to elemToFind = myParent.item('Sibling2')

    Causing elemToFind to behave differently from CS2, where you automatically got a single object reference set to one of the "Sibling2" objects, the first I think.

    As you see in the sample code elemToFind.parent is no longer a single object. Probably caused by the new nature of the object returned by xmlElement.item()

    (I might also have got the mening of "several" wrong, sorry for the confusion. I meant >1).

    Andreas

    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