BlackDawn187 Posted October 22, 2010 Posted October 22, 2010 So Im using Inet to download a the output of a php file from my webserver into a text file, from there it opens the file and saves the content to a variable. Next, I WinActivate a Program and use Send( $variable ). The problem is AutoIt seems to be stripping the "@" character out of the text. I have tried to use Send( $variable, 1) as well as Send( $variable, 0) all with no luck If anyone has some insight on how to Send a Special Character please post a reply as it places a big hurdle in my project.
PsaltyDS Posted October 22, 2010 Posted October 22, 2010 Post a short reproducer; a demo script that reproduces the primary symptom(s). How do you know it's Send() dropping the character and not that application stripping "@" from the input? Also, you should use ControlSend() vice Send() where possible for more reliable scripting. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
BlackDawn187 Posted October 23, 2010 Author Posted October 23, 2010 On 10/22/2010 at 8:07 PM, 'PsaltyDS said: Post a short reproducer; a demo script that reproduces the primary symptom(s). How do you know it's Send() dropping the character and not that application stripping "@" from the input?Also, you should use ControlSend() vice Send() where possible for more reliable scripting.I know for a fact that the program isn't stripping "@" from the Send($variable) as the symbol "@" is routinely used within the program.Its not my coding causing the problem its AutoIt not parsing something properly when sending the $variable containing the @ symbol. Perhaps parsing is the wrong word, idk.Anyways Im not going to post a demo script because the question is straight forward and, I've already dotted my i's and crossed my t's within the script im using.
Developers Jos Posted October 23, 2010 Developers Posted October 23, 2010 On 10/23/2010 at 4:32 PM, 'BlackDawn187 said: Anyways Im not going to post a demo script because the question is straight forward and, I've already dotted my i's and crossed my t's within the script im using.ok... enjoy sorting out your problems yourself. 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.
BlackDawn187 Posted October 23, 2010 Author Posted October 23, 2010 On 10/23/2010 at 4:39 PM, 'Jos said: ok... enjoy sorting out your problems yourself. Wow.. thought devs were smart enough to know what Send does but apparently they don't, heres your precious demo script $file = FileOpen("command.dat", 0) $file2 = FileOpen("oldcommands.dat", 0) $file3 = FileOpen("idle.dat", 0) $commands = FileRead($file, 100) $oldcommands = FileRead($file2, 100) $idle = FileRead($file3, 100) FileClose($file) FileClose($file2) FileClose($file3) EndIf If $commands = $oldcommands Then Sleep( 1000 ) ElseIf $commands <> $oldcommands Then BlockInput(1) WinActivate("Window Name Hur") Sleep(1000) Send( $commands ) Send( "{ENTER}" ) BlockInput(0) EndIf
jaberwacky Posted October 23, 2010 Posted October 23, 2010 Works as expected...Global $String = "@@@@" Send($String) Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Developers Jos Posted October 24, 2010 Developers Posted October 24, 2010 On 10/23/2010 at 11:03 PM, 'BlackDawn187 said: Wow.. thought devs were smart enough to know what Send does but apparently they don't, heres your precious demo scriptWow... a member with an attitude .... 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.
Bowmore Posted October 24, 2010 Posted October 24, 2010 @BlackDawn187 A reproduction script should be complete, ready to run and contain everything needed to demonstrate the problem you have. This is what a reproduction script for your problem should look like ;create a file containing commands to send $file = FileOpen(@ScriptDir & "\command.dat", 2) FileWrite($file, "@command test@test") FileClose($file) ;read commands from file $file = FileOpen(@ScriptDir & "\command.dat", 0) $commands = FileRead($file, 100) FileClose($file) ;start application run("notepad.exe") WinWaitActive("[CLASS:Notepad]") ;send commands Send($commands) Send("{ENTER}") Unfortunately for you it shows that Send() is not stripping out any characters. The problem must be elsewhere. What is the name of the application you are having problems using Send() with? "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
BlackDawn187 Posted October 25, 2010 Author Posted October 25, 2010 On 10/24/2010 at 9:22 AM, 'Bowmore said: @BlackDawn187 A reproduction script should be complete, ready to run and contain everything needed to demonstrate the problem you have. This is what a reproduction script for your problem should look like ;create a file containing commands to send $file = FileOpen(@ScriptDir & "\command.dat", 2) FileWrite($file, "@command test@test") FileClose($file) ;read commands from file $file = FileOpen(@ScriptDir & "\command.dat", 0) $commands = FileRead($file, 100) FileClose($file) ;start application run("notepad.exe") WinWaitActive("[CLASS:Notepad]") ;send commands Send($commands) Send("{ENTER}") Unfortunately for you it shows that Send() is not stripping out any characters. The problem must be elsewhere. What is the name of the application you are having problems using Send() with? I already tested the program running this script with a inputbox - > send, it just doesn't work by reading the command from the file -> send. The @ symbol gets written to the command file, but something doesn't go right between reading the command -> sending it. Sorry the demo script doesn't run out of the box its linked to a php web console and the console is in testing stages right now with no security =x I posted the script -minus the other code so you could have an idea of whats going on.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now