Re: setting insertion point at a line
Re: setting insertion point at a line
- Subject: Re: setting insertion point at a line
- From: Phil Aaronson <email@hidden>
- Date: Thu, 25 May 2006 10:41:18 -0700
Woah, I hadn't thought of that (reading in the file and computing the
location of paragraph n). I like works! But seems a little silly as
you mention :) I was wishing I knew how to insert a Build Message
object into XCode and then select it. If you can even do such a
thing. It seems like the only thing that has a line number location
in the XCode dictionary?
I'm trying to tie an error/file/line number output (from a separate
build/compiler) to kick in the editor at that point in XCode.
But thank you so very much!! This gets me going!
Phil
On May 25, 2006, at 8:45 AM, Matt Neuburg wrote:
This may be a silly way to do it, but it does work:
display dialog "What line?" default answer "1"
set n to text returned of result as integer
tell application "Xcode"
tell text document 1
set s to (get text of it)
set len to length of text from paragraph 1 to paragraph n of s
set selection to insertion point (len + 1)
end tell
end tell
That puts the insertion point at the end of the requested line. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden