chipmonger Posted February 12, 2010 Posted February 12, 2010 Need to retrieve the name of a compiled AutoIT script when it's running (I'm using the same code snippet in multiple programs and don't want to have to edit the snippet each time when pasting it into another script). I've tried to look around, but haven't been successful (probably using the wrong search terms). Any assistance would be appreciated. Thanks, Chip
Developers Jos Posted February 12, 2010 Developers Posted February 12, 2010 Did you check the Helpfile? @ScriptName maybe? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
chipmonger Posted February 12, 2010 Author Posted February 12, 2010 Did you check the Helpfile?@ScriptName maybe?Thank you. That seems to work fine, except in cases where the file name has a space in it. I can work around that replacing spaces with underscores.
Developers Jos Posted February 12, 2010 Developers Posted February 12, 2010 Thank you. That seems to work fine, except in cases where the file name has a space in it. I can work around that replacing spaces with underscores.what is the issue when the name contains spaces? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
chipmonger Posted February 12, 2010 Author Posted February 12, 2010 what is the issue when the name contains spaces?I figured it out. I'm passing the program name to a second program to update a file. Since the program name had a space when it was passed, the called program treated it as a second command line parameter. I've modified the called program to check for the second command line parameter, and if found, handle it properly.Thanks again,Chip
Developers Jos Posted February 12, 2010 Developers Posted February 12, 2010 (edited) I figured it out. I'm passing the program name to a second program to update a file. Since the program name had a space when it was passed, the called program treated it as a second command line parameter. I've modified the called program to check for the second command line parameter, and if found, handle it properly.Thanks again,ChipWhat about when you put your filename in double quotes on the commandline? Edited February 12, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
chipmonger Posted February 12, 2010 Author Posted February 12, 2010 What about when you put your filename in double quotes on the commandline?Haven't tried that. I'm just using 'Run("C:\LogFile.exe " & @scriptname)', knowing that the filename is at most two words.
Developers Jos Posted February 13, 2010 Developers Posted February 13, 2010 It's fine when it works but if you ever need it my guess would be that this should work too: Run('C:\LogFile.exe "' & @ScriptName & '"') Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
chipmonger Posted February 14, 2010 Author Posted February 14, 2010 It's fine when it works but if you ever need it my guess would be that this should work too: Run('C:\LogFile.exe "' & @ScriptName & '"') Jos Will keep that in mind. Thanks again for your help with this newbie.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now