Jump to content

A line in the code changes, eveytime the .au3 name changes?


walle
 Share

Recommended Posts

Oki, this will be pretty hard to explain. My English isn't good at all ;)

I'm searching for a script that changes a line in my code every time I switch the scripts name.

Example: I change the name on the .au3 file from hey too hey2. At the same time, a line in the code changed from hey to hey2. So it depends on the files name.

Hope you understand

//Walle

Link to comment
Share on other sites

  • Developers

Oki, this will be pretty hard to explain. My English isn't good at all ;)

I'm searching for a script that changes a line in my code every time I switch the scripts name.

Example: I change the name on the .au3 file from hey too hey2. At the same time, a line in the code changed from hey to hey2. So it depends on the files name.

Hope you understand

//Walle

You know about the macro's available like @ScriptName ?

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

Link to comment
Share on other sites

I'm 100% newbie, I will take a look at @ScriptName , but can't you explain more further? ;)

depends on the line that you want to change in your script. Post that line and we will be able to help you ...

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Thanks for the fast respone, well. My macro is very simple, just keystrokes at the moment. Played around with @ScriptName and didn't get any further. Tried:

run ("notepad.exe")

Send("@ScriptName")

The named the .au3 file "Hey.au3".

Link to comment
Share on other sites

Thanks for the fast respone, well. My macro is very simple, just keystrokes at the moment. Played around with @ScriptName and didn't get any further. Tried:

run ("notepad.exe")

Send("@ScriptName")

The named the .au3 file "Hey.au3".

Not quite. Try this:

$name = @Scriptname
run ("notepad.exe")
WinActivate("Untitled")
Send("The name of the script is: " & $name)

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • Developers

Not quite. Try this:

$name = @Scriptname
run ("notepad.exe")
WinActivate("Untitled")
Send("The name of the script is: " & $name)

Cheers

Kurt

Getting slow Gurt !!! ;)

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

Link to comment
Share on other sites

Getting slow Gurt !!! ;)

Yeah, dammit.... But who is Gurt?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • Developers

Well, Can I get rid of .au3?, Using it in to searsh for a file and it can't find it with the .au3 in the end ;)

Any of these:

StringTrimRight()

StringReplace()

StringLeft()

I am sure you figure it out ..:lmao:

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

Link to comment
Share on other sites

Sorry .. getting confused Gary-Kurt = Gurt ;)

Oh, yes... forgot that I'm GF. You're absolutely right....

Bye

Gurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Well, Can I get rid of .au3?, Using it in to searsh for a file and it can't find it with the .au3 in the end ;)

Once again, thx for the help :lmao:

$name = StringTrimRight(@Scriptname,4)

Bye

Gary-Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • Moderators

Well since we are all having fun...

$File = @HomeDrive & '\ScriptFun.txt'
FileClose(FileOpen($File, 2))
FileWrite($File, @ScriptName)
Run('"' & @SystemDir & '\notepad.exe" "' & $File & '"')
WinWait("ScriptFun.txt - Notepad")
FileDelete($File)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

Heheh, Didn't get the string thing to work, so, made it in my on way ;)

Send (@scriptname)

Send("{backspace}")

Send("{backspace}")

Send("{backspace}")

Send("{backspace}")

Hehe, I will test smokes script right away :lmao:

Send (StringTrimRight(@scriptname,4))

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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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