Skip to content

Commit 3926ad0

Browse files
author
Robert Gummesson
authored
Merge pull request #70 from epatel/master
Add goto line script
2 parents d525d3d + 9a9b947 commit 3926ad0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

BuildTimeAnalyzer/ViewController.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,23 @@ extension ViewController: NSTableViewDataSource {
285285
let item = filteredData?[row] ?? dataSource[row]
286286
NSWorkspace.shared().openFile(item.path)
287287

288+
289+
let gotoLineScript =
290+
"tell application \"Xcode\"\n" +
291+
" activate\n" +
292+
"end tell\n" +
293+
"tell application \"System Events\"\n" +
294+
" keystroke \"l\" using command down\n" +
295+
" keystroke \"\(item.location)\"\n" +
296+
" keystroke return\n" +
297+
"end tell"
298+
299+
DispatchQueue.main.async {
300+
if let script = NSAppleScript(source: gotoLineScript) {
301+
script.executeAndReturnError(nil)
302+
}
303+
}
304+
288305
return true
289306
}
290307
}

0 commit comments

Comments
 (0)