πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #589

Intermittent problem

#589
From: Shane_Stanley
Date: Tue, 17 Mar 2009 00:43
43 lines
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>
Technical Details
Message-ID: <C5E53D73.4F6B6%sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,aede52019ef843c8,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII
From: Shane_Stanley@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Intermittent problem
Message-ID: <C5E53D73.4F6B6%sstanley@myriad-com.com.au>
Date: Mon, 16 Mar 2009 17:43:47 -0700
Lines: 52
Received: from outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148] by adobeforums.com; Mon, 16 Mar 2009 17:44:26 -0700
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Al0BAC+Pvkl8qDsk/2dsb2JhbAAI1FCDfwY
X-IronPort-AV: E=Sophos;i="4.38,375,1233500400"; 
   d="scan'208";a="402657335"
Received: from unknown (HELO [10.1.1.4]) ([124.168.59.36])
  by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 17 Mar 2009 09:43:49 +0900
User-Agent: Microsoft-Entourage/12.15.0.081119
Thread-Topic: Intermittent problem
Thread-Index: AcmmmW5yl/J2fwqT1kuYswQKQoWiuA==
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit