Skip to content

Commit

Permalink
Merge pull request #70 from epatel/master
Browse files Browse the repository at this point in the history
Add goto line script
  • Loading branch information
Robert Gummesson authored Sep 13, 2017
2 parents d525d3d + 9a9b947 commit 3926ad0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions BuildTimeAnalyzer/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,23 @@ extension ViewController: NSTableViewDataSource {
let item = filteredData?[row] ?? dataSource[row]
NSWorkspace.shared().openFile(item.path)


let gotoLineScript =
"tell application \"Xcode\"\n" +
" activate\n" +
"end tell\n" +
"tell application \"System Events\"\n" +
" keystroke \"l\" using command down\n" +
" keystroke \"\(item.location)\"\n" +
" keystroke return\n" +
"end tell"

DispatchQueue.main.async {
if let script = NSAppleScript(source: gotoLineScript) {
script.executeAndReturnError(nil)
}
}

return true
}
}
Expand Down

0 comments on commit 3926ad0

Please sign in to comment.