Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting insertion point at a line



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: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Re: setting insertion point at a line (From: Matt Neuburg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.