Jump to content

Recommended Posts

Posted

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

  • Developers
Posted

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

Posted

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

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

Posted

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 *

Posted

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".

Posted

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 *

  • Developers
Posted

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

Posted

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 *

Posted (edited)

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:

Edited by walle
  • Developers
Posted

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

Posted

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 *

Posted

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 *

  • Moderators
Posted

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.

Posted

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

end (@scriptname)

Send("{backspace}")

Send("{backspace}")

Send("{backspace}")

Send("{backspace}")

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

Posted

Wait a minute now, that's getting too close to my name. JdeB, make him change his name back to /dev/null........pls. :lmao:

Or he could just change it for him. ;)
  • Developers
Posted

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

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