Thread View: adobe.scripting.indesign
5 messages
5 total messages
Started by Shane_Stanley
Tue, 17 Mar 2009 00:43
Intermittent problem
Author: Shane_Stanley
Date: Tue, 17 Mar 2009 00:43
Date: Tue, 17 Mar 2009 00:43
43 lines
2714 bytes
2714 bytes
I hate intermittent problems.
I have a script that does stuff to documents. Unfortunately, artistes also
do things to the documents. So one of the things the script does when it
opens the docs is to do some, um, repairs, including setting the default
object styles.
Because the script has to run in both CS3 and CS4, and the names of the
default styles changed between versions, I use this:
tell document 1
try
set graphicsObjStyle to object style "[Basic Graphics Frame]"
on error
set graphicsObjStyle to object style "[Normal Graphics Frame]"
end try
try
set textObjStyle to object style "[Basic Text Frame]"
on error
set textObjStyle to object style "[Normal Text Frame]"
end try
set properties of page item defaults to {applied graphic object
style:object style 2, applied text object style:object style 3}
...
This mostly runs fine, but sometimes I'll get an error: "CanοΏ½t get object
style "[Normal Graphics Frame]" of document 1." This may be in CS3 or CS4,
and if I run it again, it usually works fine. It only seems to fail in the
middle of a large batch. Not much to go on, I know.
Anyway, I'm wondering if I could just skip all that and assume the relevant
object styles are always in a fixed order, and so use:
tell document 1
set properties of page item defaults to {applied graphic object
style:object style 2, applied text object style:object style 3}
...
Can the index of the default object styles change?
--
Shane Stanley <sstanley@myriad-com.com.au>
AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Re: Intermittent problem
Author: Dave_Saunders
Date: Tue, 17 Mar 2009 01:10
Date: Tue, 17 Mar 2009 01:10
3 lines
768 bytes
768 bytes
Why not use the app.version to guide your choice, but I rather suspect that you are right that you can rely on those being at the top of the list in the right order. Dave
Re: Intermittent problem
Author: Shane_Stanley
Date: Tue, 17 Mar 2009 01:20
Date: Tue, 17 Mar 2009 01:20
12 lines
1602 bytes
1602 bytes
On 17/3/09 12:10 PM, "Dave Saunders" <member@adobeforums.com> wrote: > Why not use the app.version to guide your choice Good thought, although I'm not sure it will make a difference. My first try was a filter, as in "object style 1 whose name is x or name is y", and I still got the problem. I guess I'll just try by the numbers and see what happens. -- Shane Stanley <sstanley@myriad-com.com.au> AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Re: Intermittent problem
Author: Harbs
Date: Tue, 17 Mar 2009 11:04
Date: Tue, 17 Mar 2009 11:04
6 lines
841 bytes
841 bytes
I rely on the fact that the first is No Style and the second is Basic in a lot of my stuff. Nothing has broken yet... ;) -- Harbs http://www.in-tools.com
Re: Intermittent problem
Author: Shane_Stanley
Date: Tue, 17 Mar 2009 11:20
Date: Tue, 17 Mar 2009 11:20
10 lines
1515 bytes
1515 bytes
On 17/3/09 10:04 PM, "Harbs" <member@adobeforums.com> wrote: > I rely on the fact that the first is No Style and the second is Basic in > a lot of my stuff. Nothing has broken yet... Exactly what I hoped to hear -- thanks! -- Shane Stanley <sstanley@myriad-com.com.au> AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads