Is there a conditional command in applescript that lets the user quit the app -
is there conditional command in applescript lets user quit app. turned applescript app using automator. however, script set run until cycled through hundreds of scripts. there conditional command statement can use end application while running?
property myusername : "" if myusername "" display dialog "user name:" default answer "" buttons {"cancel", "continue…"} default button 2 copy result list {button_pressed, text_returned} set {returnedtext, returnedbutton} result list ---> {"some text", "ok"} if button_pressed "cancel" beep return end if if text_returned not "" set myusername text_returned "hello," using "karen" (returnedtext) using "karen" else display dialog "stored user name: " & myusername buttons {"ok"} default button 1 icon 1 end if "for information, please start amuse app everytime log on... , speak @ random times during visit me." using "karen" delay 20 try repeat 105 times set pathtomyfolderondesktop ("macintosh hd:users:jr:desktop:") & "dsource:" alias set rnd (random number 1 105) set rndfilename (rnd text) & ".scpt" set fullpath pathtomyfolderondesktop & rndfilename text set myscript load script (fullpath alias) run script myscript end repeat on error error_message number error_number display dialog "error: " & error_number & ". " & error_message buttons {"ok"} default button 1 return end try
you that:
display dialog "shall proceed?" buttons {"quit", "proceed"} default button 2 giving after 10 if button returned of result "quit" tell me quit
it's using giving after 10
means that script proceeds after 10 seconds when user not press button.
to quit outside isn't easy when it's automator app because same system can't use application name tell quit. maybe 1 use full path, like:
tell application "/volumes/applications/myautomatorapp.app" quit
(you can drag automator app script paste in full path)
Comments
Post a Comment