Exception: AppleScriptError
- Inherits:
-
StandardError
- Object
- StandardError
- AppleScriptError
- Defined in:
- lib/applescript.rb
Overview
name = AppleScript.gets(“What’s your name?”)
AppleScript.puts(“Thank you”)
choice = AppleScript.choose(“Which one of these is your name?”, [“Leonard”, “Mike”, “Lucas”, name])
if name == choice
AppleScript.say "You are right"
picture = AppleScript.choose_file("Find a picture of yourself")
if File.exists?(picture)
AppleScript.say "Thanks, I will now post it on Flickr for you"
# Exercise for the reader, post it on flickr
end
else
AppleScript.say "You are wrong, your name is #{name}"
end