osascript -e 'tell app "Safari" to activate' osascript -e 'set Script to "keystroke \"a\" using command down"' osascript -e do Script
This would keep going and activate TextEdit and paste into there. But I haven't gotten past this point. This results in: syntax error: Can’t set script to "keystroke \"a\" using command down". Access not allowed. (-10003)
myScript and I get: keystroke "a" using command down.
But both methods still result in: execution error: The variable do is not defined. (-2753)
The fact that it calls "do" a variable makes my head spin.
I thought about using the
expect program. I know I can run
expect and say something like
send \n to get a new line. However, that's about all I know. And I cannot find much documentation on how to send modifier keys like Cmd-A. It doesn't really matter whether
osascript as long as the end result works.
I would like to somehow get away from the select all step because it selects the entire webpage to be copied instead of just the chat box. Any help would be appreciated very much.