🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #2040

Re: [CS4 JavaScript] Adding a CrossReferenceFormat

#2040
From: Olav_Kvern
Date: Wed, 14 Jan 2009 18:35
9 lines
1128 bytes
Hi Rick,

It's most likely that "$.writeln(xrefFmt.name)" throws an error that is then handled by the catch statement. JavaScript will always think that "xrefFmt = doc.crossReferenceFormats.item(formatName)" returns a valid object--it's only when you try to use some property of that object that it'll realize that the object is invalid.

You could just change the line to: "xrefFmt.name;"--that will generate an error if the cross reference format does not exist.

Thanks,

Ole
Technical Details
Message-ID: <59b78308.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!news.glorb.com!newshub.sdsu.edu!webcrossing
References: <59b78308.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,49b15a73a3ef986c
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Olav_Kvern@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!news.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [CS4 JavaScript] Adding a CrossReferenceFormat
Message-ID: <59b78308.0@webcrossing.la2eafNXanI>
Date: Wed, 14 Jan 2009 10:35:19 -0800
References: <59b78308.-1@webcrossing.la2eafNXanI>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit