Sign in to follow this  
Followers 0
walle

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

23 posts in this topic

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

Share this post


Link to post
Share on other sites



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 ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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? ;)

Share this post


Link to post
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 *

Share this post


Link to post
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".

Share this post


Link to post
Share on other sites

run ("notepad.exe")

sleep(5000)

Send(@ScriptName)

Thanks!, just found it out myself too ;)

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

Not quite. Try this:

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

Cheers

Kurt

Getting slow Gurt !!! ;)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

#12 ·  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

Share this post


Link to post
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 ;)

Any of these:

StringTrimRight()

StringReplace()

StringLeft()

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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 *

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

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)

[center]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.[/center]

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0