• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why doesn't this script run?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't this script run?


  • Subject: Re: Why doesn't this script run?
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 05 Mar 2013 16:55:29 -0600

On Mar 05, 2013, at 16:20, Jeffrey Madson <email@hidden> wrote:
There are a lot of things I want to do with this script but the first is getting this part to function. Why don't I get a "you guessed it" and a couple of beeps if I select Asia?

default items {"Wayne"}) as string
______________________________________________________________________

Hey Jeffrey,

What's the point of setting a nonexistent default?

try

  

  set region_list to {"Wayne", "North America", "South America", "Europe", "Asia"}
  set region to (choose from list region_list with prompt ("Choose Your Region:") default items {"Wayne"})
  if region = false then error "User Cancelled."
  if region as text = "Asia" then
    beep
    display dialog "you guessed it"
    beep
  end if

  

on error e number n
  set e to e & return & return & "Num: " & n
  tell me to set dDlg to display dialog e with title "ERROR!" buttons {"Cancel", "Copy", "OK"} default button "OK"
  if button returned of dDlg = "Copy" then set the clipboard to e
end try

Turning the choose from into text directly changes your boolean on cancel false into "false".

Personally I like more descriptive error messages.

--
Best Regards,
Chris


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Why doesn't this script run? (From: Jeffrey Madson <email@hidden>)

  • Prev by Date: Re: Why doesn't this script run?
  • Next by Date: Re: Location of InDesign Library window while script is running
  • Previous by thread: Re: Why doesn't this script run?
  • Next by thread: Photoshop errors caused by "timeout"
  • Index(es):
    • Date
    • Thread