Applescript dialog trouble

topic posted Sun, March 18, 2007 - 10:11 PM by  WTL
I'm just getting started playing around with Applescript and I seem to have run into a small problem.

I'm asking a yes/no question and I want to do either continue the script or return to the main loop depending on the answer, but I'm not sure what I'm doing wrong - any suggestions would be most welcome.

The code:

if warn_before_sending is "yes" then display dialog "does this work: " & "" buttons {"No", "Yes"}

if dialog reply is "No" then
set update to "No"
else
set update to "Yes"
end if

if update is equal to "yes" then
display dialog "UPDATING YES! : " & update & return
end if

Any ideas what I'm missing?

Thanks!
posted by:
WTL
offline WTL
Canada
  • Re: Applescript dialog trouble

    Mon, March 19, 2007 - 11:21 PM
    In case anyone was wondering...

    Original:
    if warn_before_sending is "yes" then display dialog "does this work: " & "" buttons {"No", "Yes"}

    Fixed:
    if warn_before_sending is "yes" then set the_reply to display dialog button returned of "Is this working: " buttons {"No", "Yes"}

    However, in the end I changed the variable warn_before_sending to boolean, which changed the line again

    set warn_before_sending to true (* at the top of the script where I declare my variables *)
    if warn_before_sending and "Yes" is button returned of (display dialog "Is this working: " & the_status & return & "" buttons {"No", "Yes"}) then ...

Recent topics in "OS X Development"

Topic Author Replies Last Post
component kind Beau 1 January 20, 2008
grr -- having much difficulty building even the simplest plugi... 0 January 10, 2008
struct proc and sysctl(3) hoco 3 December 12, 2007
Xcode 3.0 0 November 28, 2007