Article View: adobe.scripting.indesign
Article #16170Re: [AS] Scripting how InDesign views my document
From: Daniel_Baars
Date: Mon, 06 Oct 2003 12:11
Date: Mon, 06 Oct 2003 12:11
37 lines
2073 bytes
2073 bytes
THAT WORKS! Thanks man...
I used a menu event to show/hide the structure pane. I have a feeling this is slower than scripting InDesign directly but hey, it works!
For the interested, this is one of the scripts I'm using:
tell application "InDesign 2.0.2"
set MyWindow to active window
tell MyWindow
set view display setting to optimized
set zoom percentage to 40
end tell
end tell
if my do_menu("InDesign 2.0.2", "View", "Show Structure") is false then error number -128
on do_menu("InDesign 2.0.2", "View", "Show Structure")
try
-- bring the target application to the front
tell application "InDesign 2.0.2"
activate
end tell
tell application "System Events"
with timeout of 300 seconds -- 5 minutes
tell process "InDesign 2.0.2"
tell menu bar 1
click menu item "Show Structure" of menu "View"
end tell
end tell
end timeout
end tell
return true
on error error_message
return false
end try
end do_menu
I could only do one thing with the do_menu thing, it gave me an error message when I tried to use it for something else in the same script. I'm probably doing something wrong as I'm such a newbie to this.
Technical Details
Message-ID:
<2ccda71a.3@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news-xfer2.atl.newshosting.com!63.218.45.10.MISMATCH!newshosting.com!news-xfer1.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccda71a.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,cf1cbef386390e83 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-10-06 05:38:15 PST From: Daniel_Baars@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news-xfer2.atl.newshosting.com!63.218.45.10.MISMATCH!newshosting.com!news-xfer1.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: [AS] Scripting how InDesign views my document Message-ID: <2ccda71a.3@webx.la2eafNXanI> Date: Mon, 6 Oct 2003 05:11:27 -0700 References: <2ccda71a.-1@webx.la2eafNXanI> Lines: 41 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit