AppleScript code not working, help?

Discussion in 'Mac Programming' started by PowerFullMac, May 14, 2008.

  1. PowerFullMac macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
    #1
    I am new to AppleScript and this is simple code so I am sure someone here can help!

    I want to create a dialog box where if you click No it will quit my app but if I click Yes it will do nothing... Can anyone help?

    Here is my code ATM, it wont compile.
    Code:
    display dialog "Wonna do more?" buttons {"No", "Yes"} default button 1
    	if button returned of result = "No" then
    		tell application "YouTube Video Downloader"
    		quit
    		end tell
    	else
    	(* do nothing *)
    end clicked
    
     
  2. lancestraz macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #2
    Is this going to be used in AppleScript Studio? This may or may not work in ASS... (How's that for an abbreviation).
    Code:
    display dialog "Wonna do more?" buttons {"No", "Yes"} default button 1 cancel button 1
     
  3. Sayer macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #3
    Take out the "else" and put in "end if" and it will work.
     
  4. PowerFullMac thread starter macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
    #4
    Yeah its for AppleScript Studio (well im doing it in XCode, anywho).

    Yeah, it worked, thanks :)

    But why is AppleScript in ASS (that is a good abreviation) different from normal AppleScript?
     

Share This Page