This small AppleScript / bash function opens a file and jumps to a specific line.
First, add this function to your ~/.bash_profile
:
function aquamacs-line {
aquamacs "$2"
osascript -e "
tell application \"AquaMacs\"
activate
tell application \"System Events\"
keystroke \"l\" using command down
keystroke \"$1\"
key code 36
end tell
end tell" > /dev/null 2>&1
}
Reload the shell by opening a new terminal or calling source ~/.bash_profile
. Then call it, for example with:
aquamacs-line 5 /some/file
There is of room for improvement, but it works so far. Others feel free to add/fix stuff.