🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #14504

[JS] getting position of tabs

#14504
From: Roy_Marshall
Date: Fri, 30 Jan 2004 22:55
20 lines
1240 bytes
I need some help with this small line of script:
app.findPreferences = null;
app.changePreferences = null;
myStory=app.selection[0].parentStory;
mySearch = myStory.search("^t");
myCount = mySearch.length;
myString = myStory.contents;
for (i=myCount-1; i>=0; i--)
	{
	myTab = myString.indexOf("\t",myCount);
	alert ("Count is "+myTab);
	}

I am trying to get the character posion (Index) of each tab character. There are 3 in my text, it loops 3 times, but I only get the 1st reference for each 3 tabs.

I know Dave has shown me something similar, but I am at home, and all my other stuff is at work!

Cheers

Roy
Technical Details
Message-ID: <2ccfb05c.-1@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!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,731daffab767f6f4,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-30 15:07:49 PST
From: Roy_Marshall@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: [JS] getting position of tabs
Message-ID: <2ccfb05c.-1@webx.la2eafNXanI>
Date: Fri, 30 Jan 2004 14:55:39 -0800
Lines: 23
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit