I am exasperated trying to come up with the correct syntax for this script so I am hoping some fresh eyes will help. I am using 'expect' to issue a command on a remote macine via 'ssh'. The following are the correct command line strings:
The following is the script segment is my most recent attempt that doesn't work.
I've tried lots of variations of escape and quote sequences but I just cannot get the right combination for the 'send' command so that the 'osascript' command works as it does typing it from the command line.
Can someone suggest the correct syntax to accomplish this? TIA.
Code:
ssh myuser@myhost.mydomain.com
osascript -e 'tell application "QuicKeys"' -e 'play shortcut named "Stop 4D Client"' -e 'end tell'
Code:
applescript2="-e 'tell application \\\"QuicKeys\\\"' -e 'play shortcut named \\\"Stop 4D Client\\\"' -e 'end tell'"
.
.
.
expect <<EOF
spawn ssh myuser@myhost.mydomain.com
expect myuser
send "osascript $applescript2"
expect myuser
send "exit"
EOF
Can someone suggest the correct syntax to accomplish this? TIA.