Pages

Thursday, February 28, 2013

AppleScript syntax do shell scripts


Hi guys,


i am having endless issues with the syntax of the following applescript. Please help me and i'll make you my new god, cheers. The


applescript syntax is:






tell application "Finder"


  display dialog ¬


                    "Select Output Source" buttons {"Computer", "TV"} default button "TV"


          set InternalSpeakers to (do shell script "cd ~/Downloads/SwitchAudioSource-v1; ./SwitchAudioSource -s 'Built-in Output'")


  --InternalSpeakers is now a variable which changes the sound output to Computer


          set HDMI to (do shell script "cd ~/Downloads/SwitchAudioSource-v1; ./SwitchAudioSource -s 'Soundflower (16ch)'")


  --InternalSpeakers is now a variable which changes the sound output to TV


          if button returned of result = "Computer" then InternalSpeakers


          if button returned of result = "Computer" then HDMI


end tell



at the moment i am getting the following error:





I have tried arranging and re-arranging the applescript to no avail, please help me




View the original article here

0 comments:

Post a Comment