Re : Get Current cursor position in InDesign CS
Re : Get Current cursor position in InDesign CS
- Subject: Re : Get Current cursor position in InDesign CS
- From: Olivier Ringenbach <email@hidden>
- Date: Wed, 26 Oct 2005 17:08:54 +0200
Bob,
> Only one question remains: I have been testing this in CS, and the code
> notes that the way to refer to the bounds of the text frame are different in
> CS and CS2. Both ways seem to work in my InDesign CS, but I haven't had the
> chance yet to see if only the CS2 way works in CS2.
> set {a, b, c, d} to geometric bounds of item 1 of parent text frame of
> selection -- in CS2
You should have read "parent text frames" (plural form), that's why it works
in CS. It's a list in CS2, that is the difference, the way to refer to
bounds is unchanged.
The following code compiles and works in both versions:
tell application "InDesign CS"
-- -------------------------------------- begin Shane¹s code
set thePos to horizontal offset of selection
try
set {a, b, c, d} to geometric bounds of item 1 of «class pTxS» of
selection -- in CS2
on error
set {a, b, c, d} to geometric bounds of parent text frame of
selection -- in CS
end try
set myLoc to thePos - b
-- -------------------------------------- end Shane¹s code
tell front document
tell paragraph 1 of selection
set properties to {rule below:true, rule below left
indent:myLoc, rule below line weight:0.5, rule below width:text}
end tell
end tell
end tell
--
Olivier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden