• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sv: InDesign TOC and overflowing text questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sv: InDesign TOC and overflowing text questions


  • Subject: Sv: InDesign TOC and overflowing text questions
  • From: Richard Rönnbäck <email@hidden>
  • Date: Tue, 12 Oct 2004 06:55:28 +0200

Hi Adim!

As Courtney says, the TOC scripting is badly broken.

The only workaround,  is to use of GUI scripting

 http://www.apple.com/applescript/uiscripting/index.html

A sample snippet for InDesign CS (Swedish version) goes like the one below.
Beware for line breaks, and make sure the menu names matches your language
version, or else it will fail. I have tried to indicate the English menu
names, but that is from memory, so please double check

If you have trouble getting it to work, feel free to give me a call, my
number is in the directory

Richard Rönnbäck



tell application "InDesign CS"
    activate
    --make sure the insertion point is in the text frame where the TOC to
update resides
    set selection to (insertion point 1 of text frame 1 of page 1 of active
document)
end tell
tell application "System Events"
    tell process "InDesign CS"
        tell menu bar 1
            tell menu bar item "Sida" --should be "Page" in the English
version
                tell menu "Sida" --should be "Page" in the English version
                    click menu item "Uppdatera innehållsförteckning"
--should be "Update TOC" in the English version
                end tell
            end tell
        end tell
    end tell
end tell








> Från: Courtney Schwartz <email@hidden>
> Datum: Mon, 11 Oct 2004 16:55:08 -0400
> Till: Applescript - Users <email@hidden>
> Ämne: Re: InDesign TOC and overflowing text questions
>
>
> On Oct 11, 2004, at 4:41 PM, EBI Aktivitet wrote:
>
>> Two problems...
>>
>> 1. Table Of Contents suddenly not working, and it used to be working
>> fine.
>> InDesign will quit when I run this code, and I can't make out what's
>> wrong.
>> In the document there is a TOC already, I just want to update it. I've
>> tried
>> rebuilding the TOC style, and also the entire document template, just
>> to
>> avoid getting stuck in a corrupt doc, but no success.
>
> Had a lot of this problem recently.
>
> There is a known bug where create TOC in InDesign CS is broken...
> literally, can't be gotten around, as it returns the wrong data type.
>
> You can get around this if you want by taking an old InDesign 2 script
> that creates some text based upon styles present in the document.
> Klugey, but the only way until Adobe fixes that part of the software.
>
> Search Adobe's InDesign Scripting forum for details.
>
>>
>> 2. I want to place text in a text frame, but the text might be longer
>> than
>> what the text frame visibly can contain. Each line is added as a
>> separate
>> paragraph, but when the lines hit the last visible boundary of the text
>> frame, and starts adding outside the visible bounds, the text goes
>> crazy. It
>> seems that insertion point -1 is not the right way to do this, when
>> the text
>> overflows. It seems that insertion point -1 is referenced from the
>> visible
>> insertion point, not the actual last text, so all text is added in
>> reverse
>> as soon as it hits the visible bounds. Any suggestions greatly
>> appreciated.
>
> Yeah, try something more like this:
>
> set myString to "Something to type."
> tell application "InDesign CS"
> tell active document
> tell page 1
> tell text frame 1
> set contents of insertion point 1 to myString
> // You can set more contents, it will append (although, append
> before, instead of after, myString).
> end tell
> end tell
> end tell
> end tell
>
> which works for me.
> _______________________
>
> Courtney Schwartz
>
> Documentation Specialist
> Global Technology Associates
> 3505 Lake Lynda Dr. Suite 109
> Orlando, FL 32817 USA
> (407) 380-0220 x1427
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> edband.net
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Sv: InDesign TOC and overflowing text questions
      • From: EBI Aktivitet <email@hidden>
References: 
 >Re: InDesign TOC and overflowing text questions (From: Courtney Schwartz <email@hidden>)

  • Prev by Date: Re: telling icon view options
  • Next by Date: String to sum
  • Previous by thread: Re: InDesign TOC and overflowing text questions
  • Next by thread: Re: Sv: InDesign TOC and overflowing text questions
  • Index(es):
    • Date
    • Thread