in

Quark Forums

How to specify every text box in a text chain

Last post 01-30-2009 1:31 PM by Witcher. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-30-2009 9:30 AM

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    How to specify every text box in a text chain

    I use "tell current box" for a lot of scripts where I want only to deal with that particular box. How would I target every text box within a text chain? for example I have boxes A, B, C and D linked together. Let's say I select box C. I want to target every box within that text box chain.
    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
  • 01-30-2009 9:34 AM In reply to

    • Emma
    • Top 10 Contributor
    • Joined on 07-07-2004
    • Leeds, UK
    • Posts 1,184

    Re: How to specify every text box in a text chain

     tell current text box

    tell story 1

    *do stuff*

    end tell

    end tell

    - that will target the entire text flow.

  • 01-30-2009 9:54 AM In reply to

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    Re: How to specify every text box in a text chain

    Hi Em, The trick is, I want to modify each of the boxes in the chain, as well as the text. for instance, I'd like to make the height of each box conform to the longest one in the chain. See this image below: I think maybe I need to do it through a loop, but not even sure...
    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
  • 01-30-2009 9:56 AM In reply to

    Re: How to specify every text box in a text chain

     Hi witcher,

     If you look at the text box propeprties, you will see "Previous Text Box" and "Next Text box". If your text box are indeed linked, these properties will have a reference to another text box. You can use this to navigatethrough all the text boxes of a chain

     

    Something like:

    set TB to object reference of current box

    repeat
            if previous text box of TB is not null then
                set
    TB to previous text box
            else
                exit repeat
           end if
    end repeat

    set aTextBox to TB
    repeat while aTextBox is not null
        set aTextBox to my ProcessBox(aTextBox)
    end repeat

    on ProcessBox(ThisBox)
       tell ThisBox
            -- do stuff
            return next text box
       end tell
    end ProcessBox

     Warning: This is untested code !!!

     

    HTH

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 01-30-2009 10:09 AM In reply to

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    Re: How to specify every text box in a text chain

    Hey! You're not supposed to be here!
    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
  • 01-30-2009 10:19 AM In reply to

    Re: How to specify every text box in a text chain

     I am EVERYWHERE!!! ;-)

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 01-30-2009 10:24 AM In reply to

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    Re: How to specify every text box in a text chain

    be right back... then again, maybe we should tell people to go to "the other place" for my results...
    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
  • 01-30-2009 1:31 PM In reply to

    • Witcher
    • Top 50 Contributor
    • Joined on 07-22-2004
    • philadelphia
    • Posts 287

    Re: How to specify every text box in a text chain

    http://publi-script.com/Forums/index.php?action=post;board=4.0
    The Publi Script Forum
    They taught me everything

    http://publi-script.com/Forums/index.php?board=4.0
Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems