Jump to content

Recommended Posts

Posted

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

Posted

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
Posted

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.
  :)

Posted

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
Posted (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,

Chip

What about when you put your filename in double quotes on the commandline? Edited 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.
  :)

Posted

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.

Posted

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 :mellow:

Will keep that in mind. Thanks again for your help with this newbie. :(

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...