Open moshed opened 7 years ago
AppleScript API doesn’t work through UDP. It issues commands directly (through Apple APIs? I’m not an expert in those). So the way it should work for you must be to find an instance with the port you need and issue command to that specific instance
On Tue, Dec 6, 2016 at 3:02 AM moshed notifications@github.com wrote:
i know in shell i can do echo -n black | nc -4u -w0 localhost <port number> but i can figure out how to accomplish this in applescript.
this would suggest its possible to set the udp port but i cant figure out the syntax.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tonsky/AnyBar/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/AARabHP-dfnjYgZVynXLRLYM-O4qaWnlks5rFG1igaJpZM4LEpgc .
hmm ok ill try and report my results here thanks!
I found that doing do shell script
doesn't work as you would expect. Because the echo
it uses by default doesn't support -n
. Therefore I had to provide the full path to echo. Thus my AppleScript line became:
do shell script "/bin/echo -n 'blue' | nc -4u -w0 localhost 1738"
Might want to add to the README for anyone else that tries to do this.
yeah i arrived at same conclusion @npazo did.
i know in shell i can do
echo -n black | nc -4u -w0 localhost <port number>
but i cant figure out how to accomplish this in applescript (besides usingdo shell script "command"
)http://imgur.com/a/tlRXc
this would suggest its possible to set the udp port but i cant figure out the syntax.