Sign in to follow this  
Followers 0
BlackDawn187

Special Character Variable Help

9 posts in this topic

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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

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

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

Share this post


Link to post
Share on other sites

Wow.. thought devs were smart enough to know what Send does but apparently they don't, heres your precious demo script

Wow... a member with an attitude .... ;)

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

@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

Share this post


Link to post
Share on other sites

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

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