• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting insertion point at a line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: setting insertion point at a line (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: debug universal binary on 10.3?
  • Next by Date: Re: gdb problem
  • Previous by thread: Re: setting insertion point at a line
  • Next by thread: How to load my framework programatically ?
  • Index(es):
    • Date
    • Thread