-- Starts LispWorks Personal edition, starts emacs, connects -- the two via SLIME. Only slightly modified from the version -- at http://home.comcast.net/~bc19191/blog/041219.html tell application "LispWorks Personal" activate tell application "System Events" tell process "lispworks-4-3-0-personal-darwin" repeat until get frontmost end repeat keystroke return tell window "Listener 1" if exists sheet 1 then click button "Close" of sheet 1 end if keystroke "(load \"~/.slime.lisp\")" keystroke return -- Load ~/.lispworks if it exists. keystroke "(when (probe-file \"~/.lispworks\") (load \"~/.lispworks\"))" keystroke return end tell end tell end tell end tell -- I was getting some intermittent connection refused errors that -- this short pause seemed to fix. do shell script "sleep 2" tell application "Emacs" activate tell application "System Events" tell process "Emacs" tell window 1 key code 53 keystroke "x" keystroke "slime-connect" keystroke return keystroke return keystroke return end tell end tell end tell end tell