Avoid Using "result" as Variable NameI love to use the variable "result" in my programs. For example, "set result to false". But I recently learned the hard way that is a bad choice for variable name in AppleScript. To debug my codes, I would place "display dialog anotherVar" in my program. But then when it came time to use the if-operator on the "result" variable, I'd get an strange error, such as: Can't make {<<class bhit>>:"OK"} into type boolean. It turns out that "display dialog" automatically puts the button string "OK" into the "result" variable. Chieh Cheng I started using "answer" as the variable name in place of "result". Chieh Cheng
Did your message disappear? Read the Forums FAQ. Add Comment
TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here. Messages, files, and images copyright by respective owners. |
Products
|
Services
132 Users Online
![]() |
Copyright © 1996 - 2025. All Rights Reserved. |