In this code -
on promptForReply(entryFunction, message, messageVariables, "", "", "", rememberedObjectName, "", "", "", messageVariableNames)
set answer to ""
set expandedMessage to message
if entryFunction is "notify" then
display dialog (expandedMessage)
else if entryFunction is "boolean" then
set question to display dialog expandedMessage buttons {"Yes", "No"} default button 2
set answer to button returned of question
end if
return answer
end promptForReply
on notifyMessage(message, messageVariables, messageVariableNames, rememberedObjectName)
promptForReply("notify", message, messageVariables, "", "", "", rememberedObjectName, "", "", "", messageVariableNames)
end notifyMessage
on yesMessage(message, default, messageVariables, messageVariableNames, rememberedObjectName)
promptForReply("boolean", message, messageVariables, default, "", "", rememberedObjectName, "", "", "", messageVariableNames)
end yesMessage
notifyMessage(yesMessage("Hello", "", "", "", ""), "", "", "")
set answer to yesMessage("Hello", "", "", "", "")
notifyMessage(answer, "", "", "")
applescript tags added: ACB
When this is run, both (equivalent) forms of the invocation produce a dialog, with “Yes/No” buttons followed by a second dialog which also shows the same buttons. I wanted the second dialog to show no buttons - just display the answer. It is as if the buttons are not cleared between invocations of promptForReply. Is it that the buttons, having been set in the first invocation, remain set until explicitly altered.
Comments would be appreciated.
The second question is where can I read about the difference between -
a = b
and
set a to b
Model: Macbook Air
AppleScript: 2.2.3
Browser: Chrome
Operating System: Mac OS X (10.8)