Article View: adobe.scripting.indesign
Article #14763Re: JS beginners help
From: Dirk_Becker
Date: Fri, 16 Jan 2004 14:12
Date: Fri, 16 Jan 2004 14:12
27 lines
1358 bytes
1358 bytes
If you don't already have, enable the JavaScript debugger somewhere at the top of your script:
$.level = 2;
Then if you again hit that error, examine the problem variable.
For example, try this expression:
typeof myPound
I suspect yours is something like undefined or null.
Without debugger / during execution you check it this way:
if( myPound ==null ) {
// the "==" operator catches both null and undefined
alert("bummer");
exit();
}
to get more specific info, try this:
var undefined; // intentionally not initialized
// the "==="operator checks for exact match
if( myPound ===null ) alert("null");
else if( myPound ===undefined ) alert("undefined");
else alert(typeof myPound);
Dirk
Technical Details
Message-ID:
<2ccf45cf.29@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf45cf.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,613db9f5b5ffc527 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-16 06:37:53 PST From: Dirk_Becker@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: JS beginners help Message-ID: <2ccf45cf.29@webx.la2eafNXanI> Date: Fri, 16 Jan 2004 06:12:25 -0800 References: <2ccf45cf.-1@webx.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit