To end a screen process you should type this:
ctrl-a
ctrl-\
y
But how to send a ctrl command to terminal using an apple script?
To end a screen process you should type this:
ctrl-a
ctrl-\
y
But how to send a ctrl command to terminal using an apple script?
This should do the trick:
do shell script "{ killall SCREEN; killall screen; :; } &> /dev/null"
Note this will kill all instances of screen, in case there is more than one running.
I don't know if it's overkill to do it this way, but I have sometimes seen the all-caps process appear when I use screen, so this just makes sure that all bases are covered. The colon means "do nothing" and since it always returns error code 0 (meaning no error), it prevents AppleScript potentially complaining about an error in case screen isn't running (otherwise, you'd have to wrap the command in a try...end try). Same goes for the redirection to /dev/null so you don't hear about an error that doesn't matter.
You could also simulate the keystrokes themselves using GUI Scripting (see http://www.macosxautomation.com/applescript/uiscripting/). This is more work and less reliable, so I'd just do the above.