Getting the name of the running script

5 posts / 0 new
Last post
avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28
Getting the name of the running script

Hi Brian
Is there a system field that holds the name of the running script?
for example: I have few versions of the same script. They are all having the same name suffixed by V1, V2, V3, etc.
The scripts generate excel files and I want to make sure the generated excel files are stored in different folders, depending on which version of the script is running.
 
Thanks a lot!
Avi

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Avi,

The only thing I can think of is to have a variable in each of the scripts that holds the script name, such as:

sScriptName = "This is my script.iss"

You then reference this variable to see which script you are running.  Does that help solve the problem?  Unfortunately there isn't a function  like in Excel where you can get the name of the current spreadsheet.

Brian

avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28

Thanks Brian but the whole idea is to avoid the need to remeber which version of the script we are running, after all we tend to create and delete versions in a high pace, so it will be a challenge to keep the variable current. 
Regards, Avi

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

I have been trying to figure out if there is a way and I can't seem to find one.  There doesn't seem to be a way to test if the file is open or locked.

Sorry, I don't seem to be able to help you out on this one.

avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28

Thats OK Brian, normally, when something is categorically not possible it indicates that a new way of thinking is required,
probably it is not a good idea to create directories based on which version of the script you are running, I will  think of some other , less kludgy, ways to handle my growing population of libraries :-)
Take care,
Avi