[Closed] Acquiring filepath of script from within itself
Is it possible to get the filepath of a script that is being executed from within itself? Similar-ish to the way using “this” refers to the script controller that it is part of.
I’m working on a menu-building script that recreates a folder structure full of scripts as a top menu with all the scripts as options in that menu (and sub-menus from sub-folders). I’d also like it to be able to install itself in the startup folder when first run. I also want the menu to be able to be reloaded from within itself when a script is added to the folder so to do that I want to put a copy of itself in the top folder of the folder structure where the menu is being built from. If that makes sense? The path to the folder structure will be defined by the user on first run and set in an .ini file rather than hard-coded.
Cheers,
Cg.
Yes, I use this feature all the time. It’s super useful
getSourceFileName()
getSourceFileName()
Edit: Oops, grabjacket beat me to it by a few seconds