Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MediaGuy4

macrumors newbie
Original poster
Apr 10, 2019
1
0
I'm new to AppleScript and Automator and seeking help and resources to set up this workflow.

I'm looking to turn of a bunch of microphone devices in a meeting using a script. I can do this successfully using Putty or the Mac Terminal. But to automate it I really it a script. So I attempted to use AppleScript and created the following, which works...but I know there's a better way!

I'd like the whole process to happen in the background without opening the Terminal program. Any advice on how to do this? The device I'm connecting to does not use SSH, but a raw TCP connection, so that's the reason for the "NC" connection.

Thanks in advance!
tell application "Terminal" to activate

tell application "System Events"

keystroke "nc 192.168.34.78 2202"
delay .5
key code 36
delay 0.5
keystroke "< SET 0 PHANTOM_PWR_ENABLE OFF >"
delay 0.5
key code 36
delay 3
key code 8 using control down

tell application "Terminal" to quit

end tell
 
Could you create an Automator application with a "Run Shell Script" action and put your original shell script into that, instead of using AppleScript?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.