Just a quick applescript question

Discussion in 'Mac Programming' started by guitarmaster18, May 23, 2007.

  1. guitarmaster18 macrumors regular

    guitarmaster18

    Joined:
    Mar 27, 2007
    #1
    Yeah, i just have a quick applescript question. If you were using something like this:
    Code:
    set start to display dialog "Test" buttons {"Test"}
                          if button returned of start is "Test" then
                          set start2 to display dialog "Test2" buttons {"Back"}
                          end if
                          if button returned of start2 is "Back" then
                          
    how would you put something like "go back to start" or "return to start" to make it go back to the variable "Start"? I need help with this one. You got any ideas?
     
  2. MongoTheGeek macrumors 68040

    MongoTheGeek

    Joined:
    Sep 13, 2003
    Location:
    Its not so much where you are as when you are.
    #2
    Code:
    repeat
    	set aButton to button returned of (display dialog "Start" buttons {"Forward", "Backward"})
    	if aButton = "Backward" then
    		display dialog "Oops hit a wall"
    	else
    		set aButton to button returned of (display dialog "End" buttons {"Forward", "Backward"})
    		if aButton = "Forward" then exit repeat
    	end if
    end repeat
    display dialog "Escaped"
    
    This is really sort of ugly. Especially if you are doing something complicated with it. What is your plan/goal?
     

Share This Page