Question…
I have made an Applescript to auto start and kill an ASR stream but have one last snag…
It is calling shell script commands and I cannot get them to output correctly…can someone help?
I need the “asr” command to output to something (terminal, a file, anything at all) so I can see the status of the command. The applescript developers page describing calling shell scripts falls short here…maybe someone can help me out?
Here is the script…it works fine right now, just cannot see what ASR is doing…
--Created by: Jimmy Schrage
--08/10/06
--Sets up and kills a Multicast stream on OS X server 10.4.3 or later
--Start it up!
display dialog "Please click OK to start the ASR Multicast session" buttons {"OK"} default button "OK"
--Enter Administrator Username
set userName to ""
display dialog "Please enter your Administrator username:" default answer "admin"
set userName to (text returned of result) as string
--Enter Administrator Password
set adminPass to ""
display dialog "Please enter your Administrator password:" default answer ""
set adminPass to (text returned of result) as string
--Choose the .DMG file (MAKE SURE THERE ARE NO SPACES IN THE FILE PATH)
choose file
set dmgPath to (result) as text
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {":"}
set dmgPath to text items of dmgPath
set AppleScript's text item delimiters to {"/"}
set dmgPath to dmgPath as string
set AppleScript's text item delimiters to ASTID
set dmgPath to "/Volumes/" & dmgPath
--See what the string path returns...
--display dialog "This should have / not : " default answer dmgPath
--Start the ASR process using the COCmulticast plist for the ASR Stream specifications
--Be sure to change the PLIST location
do shell script "asr -source " & dmgPath & " -server /Volumes/ServerHD/Applications/Utilities/Multicast/PreConfigPlists/COCmulticast.plist -interface en0 &> /Volumes/ServerHD/Users/admin/Desktop/asrlog 2>&1 & echo $!" user name userName password adminPass with administrator privileges
set pid to the result
display dialog "Please click OK to end the ASR Multicast session" buttons {"OK"} default button "OK"
--Kill the ASR process
do shell script "kill " & pid user name userName password adminPass with administrator privileges