Skip to content

Instantly share code, notes, and snippets.

@irlabs
Forked from dunkelstern/xed.sh
Created November 11, 2016 08:25
Show Gist options
  • Save irlabs/66bb0868825ddd4fb7e4f721cf69f0d5 to your computer and use it in GitHub Desktop.
Save irlabs/66bb0868825ddd4fb7e4f721cf69f0d5 to your computer and use it in GitHub Desktop.
xed "reimplementation" to fix broken Xcode 4 xed
#!/bin/bash
if [ "$1" = "-l" ] || [ "$1" = "--line" ] ; then
line=$2
file=$3
else
line=1
file=$1
fi
osascript &>/dev/null <<EOF
tell application "Xcode"
open "$file"
activate
tell application "System Events"
tell process "Xcode"
keystroke "l" using command down
repeat until window "Open Quickly" exists
end repeat
click text field 1 of window "Open Quickly"
set value of text field 1 of window "Open Quickly" to "$line"
keystroke return
end tell
end tell
end tell
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment