• 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
Scripting Xcode to open a source code file and go to a particular line number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Xcode to open a source code file and go to a particular line number


  • Subject: Scripting Xcode to open a source code file and go to a particular line number
  • From: Brooks Bell <email@hidden>
  • Date: Sun, 26 Apr 2009 22:05:54 -0700
  • Thread-topic: Scripting Xcode to open a source code file and go to a particular line number

I'm writing a Cocoa utility that scans crash logs.  I have the source code
file name and line number of the crash and I'd like to open the file in
Xcode and scroll to the line in question.

At this point I'm doing it with SystemEvents:

tell application "Xcode"
    activate
    open "%@"

    tell application "System Events"
        keystroke "l" using {command down}
        keystroke "%@"
        keystroke return
    end tell
end tell

(the %@ symbols get replaced before running with the file path and line
number).

Is there a better way to initiate Xcode's "go to line #" function?



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Scripting Xcode to open a source code file and go to a particular line number
      • From: Christopher Nebel <email@hidden>
  • Prev by Date: Mail: Open message problem solved
  • Next by Date: list files with different locations in finder
  • Previous by thread: Mail: Open message problem solved
  • Next by thread: Re: Scripting Xcode to open a source code file and go to a particular line number
  • Index(es):
    • Date
    • Thread