PDA

View Full Version : AppleScript code not working, help?




PowerFullMac
May 14, 2008, 12:25 PM
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.
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



lancestraz
May 14, 2008, 01:29 PM
Is this going to be used in AppleScript Studio? This may or may not work in ASS... (How's that for an abbreviation).
display dialog "Wonna do more?" buttons {"No", "Yes"} default button 1 cancel button 1

Sayer
May 14, 2008, 04:41 PM
Take out the "else" and put in "end if" and it will work.

PowerFullMac
May 15, 2008, 03:22 AM
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?