Jump to content

Insert Var


Guest GRonken
 Share

Recommended Posts

Guest GRonken

How do I insert a varable into a send statement to send. I did it in

version 2 ...

;Enter the File name

Send, %Filename%

Now I?

EnvSet("FileName", "charges_@YEAR@MON@M...")

;Enter the File name

Send("@FileName")

Sleep(4000)

Thanks in advance

Link to comment
Share on other sites

You can now call out variables directly

$filename="autoit.exe"
send($filename)

or

$filename = InputBox("Question", "Whatfilename?", "", "", -1, -1, 0, 0)
sleep("2000")
send($filename)

or say

$FileName="charges_" & @YEAR & @MON & @MDay & ".txt")
send($filename)

edit ... enclose text in quotes, leave variables and @ macros ourside with &

AutoIt 2 you could put inside like PhP, AutoIt3 you have outside like VB.

V2="Charges_%YEAR%.txt"

V3="Charges_" & @YEAR & ".txt"

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Don't forget about send's optional flag: Send($filename, 1)

in case your filename contains ! or + or ^ or #.

Note, by setting the flag parameter to 1 the above "special" processing will be disabled. This is useful when you want to send some text copied from a variable and you want the text sent exactly as written.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...