get name of me

hi
can someone please tell me how I can add something to a script that gets the name of that script and assigns it to a variable inside the script?
ta!!

This should work on scripts saved as applications.

set my_name to name of (info for (path to me))

– Rob

That is the key. When ran from a script editor window,

will yeild “scripteditor.app”. The script has to be saved and ran as an application to get the name. You can see this demonstrated by saving

try running from the editor window and then run the saved script to see the two results.
SC