Article View: adobe.scripting.indesign
Article #14714Re: JS beginners help
From: Roy_Marshall
Date: Mon, 19 Jan 2004 09:03
Date: Mon, 19 Jan 2004 09:03
36 lines
2206 bytes
2206 bytes
Dave
I appreciate you advise and help, thankyou for your patients. I went out and got a beginners guide to Javascript on saturday. It will certainly help me with the syntax etc. I notice it was old (1996), and is web based, but i guess that shouldn't effect me.
I have spent several hours over the weekend pondering over the existing problem i have. I have run tests, checks, in the debugger window with no avail. Could you have a look at this following script for me and let me know your thoughts? I have included some remarks to let you know what i was getting.
Thanks a lot,
Roy
myText = app.selection[0].parentStory;
myString = myText.contents;
app.myfindPreferences = null;
app.mychangePreferences = null;
//There are 2 instances of "�" in the selected text frame
myPound = myString.search("�"); //When I get result of myPound in console, I only get "11" (the character position of the first "�")
//Also, "typeof mypound returns "number". Shouldn't this be an array?
myPoundCount = myPound.length; //When I get result of myPoundCount in console, I get "undefined"
//this next section does diddly squat! I guess because myPoundCount in undefined.
for (i=myPoundCount; i>0; i--)
{
myResult = myString.indexOf("�",i)
myLine = myResult.parentLine;
if (myLine.search("*^t") == true)
{
myLine.search("*^t", false, false, "*t",{appliedParagraphStyle:"Body Text right indent"},{appliedParagraphStyle:"Goerge Kidner body text"});
}
}
Technical Details
Message-ID:
<2ccf45cf.36@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf45cf.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,613db9f5b5ffc527 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-19 01:07:32 PST From: Roy_Marshall@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: JS beginners help Message-ID: <2ccf45cf.36@webx.la2eafNXanI> Date: Mon, 19 Jan 2004 01:03:41 -0800 References: <2ccf45cf.-1@webx.la2eafNXanI> Lines: 48 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit