🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17840

Re: AS Selecting parent paragraph

#17840
From: Roy Marshall
Date: Tue, 13 May 2003 21:07
22 lines
2009 bytes
Ok!! As you can tell, i am still learing. Next problem....
I am attempting to get a horizontal offset of the last character in a paragraph, then moving the insertion point to the left and getting that horizontal offset, and comparing the 2, if the horizontal offset of point 2 is greater than point 1 I know i have moved up 1 line in the paragraph, and tharefore insert a new line so i can apply a different par style to the last line. confused?? I am!!
At the moment I am getting the first horizontal offset ok, but i am only getting the character contents, and not the offset of the 2nd reference character. Here is the code
tell application "InDesign 2.0.2"
	activate
	set myselection to selection
	set mypound to search myselection for "�"
	repeat with n from (count of mypound) to 1 by -1
		set myposition to horizontal offset of item n of mypound
		set mypara to paragraph 1 of item n of mypound
		repeat with x from (count of characters in mypara) to 1 by -1
			set mycharacter2 to item x of mypara
			set myposition2 to horizontal offset of item x of mypara --this line fails to work
			display dialog myposition2
		end repeat
	end repeat
end tell

Any help would be good
Cheers

Roy
Technical Details
Message-ID: <1de91cfb.2@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de91cfb.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,7dfee35d0c727d0
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-13 14:38:17 PST
From: "Roy Marshall" <royston_marshall@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: AS Selecting parent paragraph
Message-ID: <1de91cfb.2@WebX.la2eafNXanI>
Date: Tue, 13 May 2003 14:07:46 -0700
References: <1de91cfb.-1@WebX.la2eafNXanI>
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit