Is there a way to set a variable to the name of the current running script?
I wrote a script to backup files from our server, and from time to time, I modify the script, and change the version number of the script. At the end of the script, it generates a report that includes everything that it did. One thing that I want in that report is which version of the script is running. I change the name of the script in the Finder everytime I edit it. For example… Backup Script v1.03 becomes Backup Script v1.04. Right now, I manually change the version number in the script, but I’d really like the script to pickup it’s own name.
This works if the script is run from the script menu or if it is saved as an application. You can change the name in Finder and the dialog will show the updated name.
set myName to name of (info for (path to me))
display dialog myName
j
EDIT: Just saw Mark’s post. I should have said that it won’t work when run from Script Editor - well, it does, but just displays “Script Editor.app”