Applescript System Events Keystroke broken after 10.9.4

applescriptterminal

It seems like the recent Mavericks update has broken the keystroke command in applescript — whenever my script reaches that point, it freezes. (I currently have ~20 zombie osascript processes…)

Furthermore, there isn't anything in the accessibility options to allow applescripts to automate keystrokes.

This is my script currently.

tell application "Terminal"
    activate
end tell
delay 0.1
tell application "System Events" to tell process "Terminal"
    keystroke "t" using command down
end tell
tell application "Terminal"
    do script "cd ~/some_folder_here" in front window
end tell

If there's a way to tell terminal to directly open a tab (or if iterm 2 can do that) that could also be a solution.

Best Answer

It turns out that the System Events process on my machine was frozen (which I discovered after a node process refused to be killed). Performing a full restart fixed the problem.