Using your suggestion, Shane, I looked at the example that you wrote in Script Debugger 6, tutorials & how-tos regarding ApplescriptObjc.
To further understand your reply. With your tutorial, to the above script,
I added a script property
property returnCode : missing value
Later in the script, following the line
my performSelectorOnMainThread:"displayAlert:" withObject:theAlert waitUntilDone:true
I added the command
returnCode
Those additions succeeded in returning 1000 for the default button and 1001 for the second button, when one of those buttons was clicked.
When, however, I substituted the command
set returnCode to my performSelectorOnMainThread:"displayAlert:" withObject:theAlert waitUntilDone:true
AppleScript execution raised an error with
The variable returnCode is not defined.
I have searched for a meaning to the property
returnCode
but could not find an Applescript reference to it, outside of your example, on latenightsw.com web page, referenced above.
Perplexed, I have two questions, that I hope you can answer.
One, does the property
returnCode
have a special meaning?
Two, why does the returnCode receive the value of the button pressed in the alert dialog when returnCode follows in the next line of code, but does not receive that value when it is assigned a value via the set command, as in the following line?
set returnCode to my performSelectorOnMainThread:"displayAlert:" withObject:theAlert waitUntilDone:true
Thank your for your great help, tutorials, and insights.