Skip navigation

With CS3, some things have changed

May 1, 2007 4:53 AM

  Latest reply: Andreas Jansson, Jan 25, 2010 12:33 AM
Replies 1 2 3 2 Previous Next
  • Currently Being Moderated
    Feb 28, 2008 10:08 AM   in reply to (Dave_Saunders)
    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'}
    );
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2008 1:38 PM   in reply to (Dave_Saunders)
    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.
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2008 2:50 PM   in reply to (Dave_Saunders)
    thanks jongware! i think this shows that either me or adobeforums.com suck at searching.
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2008 4:09 PM   in reply to (Dave_Saunders)
    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
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2008 7:15 AM   in reply to (Dave_Saunders)
    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.
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2008 8:19 AM   in reply to (Dave_Saunders)
    Sandee,

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

    Peter
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2008 9:11 AM   in reply to (Dave_Saunders)
    Duhhhhh, how obvious!
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2008 2:18 PM   in reply to (Dave_Saunders)
    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>
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2008 3:13 PM   in reply to (Dave_Saunders)
    >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
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 17, 2008 1:59 AM   in reply to (Dave_Saunders)
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 22, 2008 10:27 PM   in reply to (Dave_Saunders)
    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
     
    |
    Mark as:
  • Currently Being Moderated
    May 20, 2008 3:03 PM   in reply to (Dave_Saunders)
    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
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2008 5:59 AM   in reply to (Dave_Saunders)
    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?
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2008 9:10 AM   in reply to (Dave_Saunders)
    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
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 18, 2008 10:22 PM   in reply to (Dave_Saunders)
    how to convert bottom statement from cs2 to sc3

    phcode.Rotate (deg)
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 28, 2008 2:06 PM   in reply to (Dave_Saunders)
    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.
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 7, 2009 9:27 AM   in reply to (Dave_Saunders)
    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
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 19, 2010 8:23 AM   in reply to (Dave_Saunders)

    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).

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 22, 2010 5:10 PM   in reply to Andreas Jansson

    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("c haracter")

            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

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 25, 2010 12:33 AM   in reply to AdobeScripts

    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

     
    |
    Mark as:
1 2 3 2 Previous Next
Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)