I have an applet which, when an error is encountered, will give the user the option to email me about the error. The email automatically includes the version of the applet that encountered the error. Or at least it would, except for this weird behaviour.
When I compile current application’s version in SD it simply becomes version (i.e. “current application’s” disappears). Nevertheless, if the script is then run it will work as expected. But if I make some changes/additions to the script and compile it again, version just seems to become a string or something.
Steps to reproduce:
- copy and paste the below code into a new SD document (it doesn’t seem to matter whether it’s a script or an applet)
- compile (current application’s version will become version)
- run (script behaves as expected, in my case the alert text is “7.0.6”)
- make any addition to the script (e.g. add message “See what I mean?” to the display alert command)
- compile and run (alert text will be “version”)
- if you add current application’s before version, compile and run again the behaviour will be as point 3 above
use AppleScript version “2.4” – Yosemite (10.10) or later
use scripting additions
display alert ((current application’s version) as text)