IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts

Thursday, March 28, 2013

syntax for do shell script output displayed as list in applescript


Hi guys,


I am looking for the correct syntax for a


do shell script command in applescript,


where the results of the do shell script command are displayed as a list in applescript,


whereupon i can then choose one of these given results and move on from there, this is where i have gotten to:





my issue is that the results are as follows when done in terminal:



but when done in applescript i only see this:



obviously the terminal results need to be handled in some special manner that i am unaware of,


to handle each line in the terminal results as a single option in my list. Anyone got any idea how to do this?


cheers


View the original article here

Wednesday, March 20, 2013

syntax for do shell script output displayed as list in applescript


Hi guys,


I am looking for the correct syntax for a


do shell script command in applescript,


where the results of the do shell script command are displayed as a list in applescript,


whereupon i can then choose one of these given results and move on from there, this is where i have gotten to:





my issue is that the results are as follows when done in terminal:



but when done in applescript i only see this:



obviously the terminal results need to be handled in some special manner that i am unaware of,


to handle each line in the terminal results as a single option in my list. Anyone got any idea how to do this?


cheers


View the original article here

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

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

Re: AppleScript syntax do shell scripts

You're over complicating the situation. This

 

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

 

sets InternalSpeakers to what the do shell script returns. It does not set InternalSpeakers to hold the do shell script command to run when you access the variable. There are ways to do this but its not needed here. Just do thsi as a simple if then else

 

display dialog ¬

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

 

if button returned of result = "Computer" then

     do shell script "cd ~/Downloads/SwitchAudioSource-v1; ./SwitchAudioSource -s 'Built-in Output'"

 

 

else    if button returned of result = "TV" then


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

 

 

end if

 

Something like this will work.  Also there is no reason for the code you show to do it in a tell block. The Finder isn;t needed for this.


View the original article here

Re: AppleScript syntax do shell scripts

You're over complicating the situation. This

 

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

 

sets InternalSpeakers to what the do shell script returns. It does not set InternalSpeakers to hold the do shell script command to run when you access the variable. There are ways to do this but its not needed here. Just do thsi as a simple if then else

 

display dialog ¬

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

 

if button returned of result = "Computer" then

     do shell script "cd ~/Downloads/SwitchAudioSource-v1; ./SwitchAudioSource -s 'Built-in Output'"

 

 

else    if button returned of result = "TV" then


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

 

 

end if

 

Something like this will work.  Also there is no reason for the code you show to do it in a tell block. The Finder isn;t needed for this.


View the original article here