do shell script "echo /cue/selected/start >/dev/udp/localhost/53535"
But suppose I'm trying to address the time1Pl cue, and change its live text value to "4.0000". If I send the following command as an OSC Message network cue in QLab, it works:
/cue/time1Pl/text "4.0000"
Trying to send the same command via do shell script in Applescript, I believe, should look like this:
do shell script "echo /cue/time1Pl/livetext \\\"4.0000\\\" >/dev/udp/localhost/53535"
This command doesn't work. I'm assuming it has something to do with escaping the quotes around 4.0000. I've seen a couple different ways online of what's supposedly necessary to escape quotes in a shell script, but maybe I don't have it right.
Any ideas?
TIA,
M2
tell application id "com.figure53.QLab.4" to tell front workspace
set oscCmd to "/cue/time1Pl/liveText \"4.00\""
do shell script "echo " & the quoted form of (oscCmd) & " | nc -u -w 0 127.0.0.1 53535"
end tell
Mic
I'm having a heck of a time sending OSC commands through Applescript.
Trying to send the same command via do shell script in Applescript, I believe, should look like this:
do shell script "echo /cue/time1Pl/liveText \\\"4.0000\\\" >/dev/udp/localhost/53535"
do shell script "echo /cue/time1Pl/liveText \"4.0000\" >/dev/udp/localhost/53535"
I had read somewhere else before my original post (here: https://stackoverflow.com/questions/14737414/using-double-quotes-in-applescript-command-do-shell-script-echo) that the extra slashes were necessary because of how the shell parses the command. That link doesn't explain why very well, but it gave me the idea to try that.
Mic, as to your other suggestion -- to split the specific OSC command out into its own variable -- that's very useful and I will likely use that. It would let me avoid a lot of this foolishness with the quotes & split off the actual sending of the UDP command to a handler.
do shell script "echo '/cue/time1Pl/liveText \"4.00\"' | nc -u -w 0 127.0.0.1 53535"
Mic’s version: echo '/cue/1/liveText "4.0000"' returns /cue/1/liveText "4.0000"
Your version: echo /cue/1/liveText \"4.0000\", also returns /cue/1/liveText "4.0000"
to your comment about escape characters, using my original syntax, this does not work:do shell script "echo /cue/time1Pl/liveText \"4.0000\" >/dev/udp/localhost/53535"