Send> is writting text backwards

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
AntoniusMomac
Junior Coder
Posts: 20
Joined: Fri Dec 07, 2007 7:46 am
Location: New York City, NY

Send> is writting text backwards

Post by AntoniusMomac » Thu Oct 23, 2008 10:38 pm

Hi Guys.

I'm lost on this one. I have a script that is going through a few subroutines, returns to a send text command:and:

Code: Select all

Send>Test
-However, this text is written in the text box as: tseT

Any thoughts. I couldn't find any sys vars or anything obvious. Please help. It could be something crazy.

btw, it is happening on an XP machine.
Love Simple!! "Simplicity means the achievement of maximum effect with minimum means" - Dr. Koichi Kawana, Architect, designed the botanical gardens

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Thu Oct 23, 2008 11:15 pm

Greetings AntoniusMomac,

My first thought is... you have a variable named "Test" which contains the character string "tseT".

Any chance you can post your script? Without that, I'm not sure how much more anyone can help.

Hmm... what happens if you just run a short script like this:
  • Let>var=Test
    Send>var
Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Oct 24, 2008 8:18 am

What happens if you do:

Send>{"Test"}

That sends the literal value so if you do have a variable called Test it won't use it.

Also, try slowing down the send rate. Perhaps the application can't keep up!

Let>SK_DELAY=50
Send>{"Test"}

Open your script in the Advanced Editor and select Tools/Variable Explorer. Do you see a variable called Test?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
AntoniusMomac
Junior Coder
Posts: 20
Joined: Fri Dec 07, 2007 7:46 am
Location: New York City, NY

Thank you Marcus

Post by AntoniusMomac » Fri Oct 24, 2008 4:09 pm

Hi Marcus,

I'm sorry that I didn't try this before. It is machine related as the script run fine on my machine (vista box) but not on my colleagues’.

I don't know how to then go about finding out what is having an ill effect on MS' operation. It's something else, but I don't know what is causing it.

Do you have any suggestions?



-AM
Love Simple!! "Simplicity means the achievement of maximum effect with minimum means" - Dr. Koichi Kawana, Architect, designed the botanical gardens

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Oct 24, 2008 5:18 pm

Hi AntoniusMomac,

I have no idea why that machine is reversing the strings and you should keep looking to find out why and fix it.

Until then, if you want to get the script working on that machine... see the example below. If you reverse a string before you send it, theoretically it should come out in the right order.

If you try it, let us know how it works... and of course if you find out what is causing the odd behavior on that machine in the first place.

Code: Select all

VBSTART
Function ReverseString (myString)
 ReverseString = StrReverse(myString)
End Function
VBEND

//set your variable to the literal string "Test" 
Let>my_text_variable={"Test"}

//send it normally
Send>my_text_variable
Send>%CRLF%

//first "vbEscape" your string, in case it contains a double quote "
StringReplace>my_text_variable,","",my_text_variable
//then reverse your string
VBEval>ReverseString("%my_text_variable%"),my_text_variable

//send it reversed
Send>my_text_variable
To test it:

1) copy the above to create yourself a script
2) assign the script to a HotKey, say F11
3) open up a Notepad window
4) hit F11 and the script should send the following on a normal machine
Test
tseT

Now try the same procedure on that suspect machine. If the results are flipped and come out like this...
tseT
Test

...then that machine is truly reversing strings sent by MS... very odd.

But if not... then I'd suggest you post your code if you want more help.

Take care
Last edited by jpuziano on Fri Oct 24, 2008 6:18 pm, edited 2 times in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Oct 24, 2008 5:30 pm

Do you have any keyboard shortcut tools on that machine like phraseexpress? Have you checked to make sure you don't have any keyloggers or any other malware on the PC? Seems to me like you may have a program on the PC which is intercepting keystrokes and processing them.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
AntoniusMomac
Junior Coder
Posts: 20
Joined: Fri Dec 07, 2007 7:46 am
Location: New York City, NY

Post by AntoniusMomac » Fri Oct 24, 2008 5:43 pm

Thanks jpuziano. That Vbscript function will work great.

quick off topic question regarding vbscript, how do you test/run/debug those functions?

Marcus, thank you for the heads up on the key logger, I'll try to get some answers and report back. I hope it is something simple, like that, and we can put set issue to rest.
Love Simple!! "Simplicity means the achievement of maximum effect with minimum means" - Dr. Koichi Kawana, Architect, designed the botanical gardens

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Oct 24, 2008 6:12 pm

AntoniusMomac wrote:Thanks jpuziano. That Vbscript function will work great.

quick off topic question regarding vbscript, how do you test/run/debug those functions?
The same way as any MS code, write it, run it, read the error msgs, adjust the code, run it again, etc.

If stumped, search the forums here using bits of the error msgs to see if others ran into the same problem and what the solution was. If not, try Googling the web or post here with the problem.

There is the MS debugger of course but I don't think it was built to debug VBscript code. Marcus can no doubt offer you a much more detailed answer on how to best debug the VBscript parts of your code.

For my part, I am just happy I can take advantage of the odd VBScipt function here and there as necessary.

A warning on using the above posted code though... it will fail if your string happens to contain a double quote " so to escape those, you must replace each occurance of " with "" in your string before passing it to that VBScript function. Take a look at the example Marcus has in the Help file for StringReplace:
  • Let>string=Your name is "Fred"
    StringReplace>string,","",vbEscapedString
For safety’s sake, I'll modify the code I posted to add a line for this... in case someone finds it and uses it in future.

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
AntoniusMomac
Junior Coder
Posts: 20
Joined: Fri Dec 07, 2007 7:46 am
Location: New York City, NY

Final Resolution

Post by AntoniusMomac » Tue Oct 28, 2008 2:44 pm

Upon Further Testing, I observed the following.

Easy work around:

If I set the SK_Delay to 1 or higher, MS and that one particular form play nice. If I don't set it or set it to zero (same difference) then I see the issue... So I just set the SK_Delay to human speed.

In case anyone is following this Tread:
The one thing I noticed that was different about this particular form; it has a RichTextWndClass. The TfrmEditor (MS) has a TRichEdit "" (TPanel). I think these pieces aren't playing Nice.
Love Simple!! "Simplicity means the achievement of maximum effect with minimum means" - Dr. Koichi Kawana, Architect, designed the botanical gardens

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Final Resolution

Post by Marcus Tettmar » Tue Oct 28, 2008 2:48 pm

AntoniusMomac wrote:Upon Further Testing, I observed the following.

Easy work around:

If I set the SK_Delay to 1 or higher, MS and that one particular form play nice. If I don't set it or set it to zero (same difference) then I see the issue... So I just set the SK_Delay to human speed.
So this app is processing the keystrokes as it is receiving them, and it can't keep up when they are sent too fast.
The one thing I noticed that was different about this particular form; it has a RichTextWndClass. The TfrmEditor (MS) has a TRichEdit "" (TPanel). I think these pieces aren't playing Nice.
Purely a coincidence. Millions of apps have rich edit controls.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
AntoniusMomac
Junior Coder
Posts: 20
Joined: Fri Dec 07, 2007 7:46 am
Location: New York City, NY

Post by AntoniusMomac » Tue Oct 28, 2008 3:07 pm

Purely a coincidence. Millions of apps have rich edit controls.
This is True Marcus, but what I wanted to say is that there is something in particular with this form and its RichText control that are causing issues. If anyone finds that most form take text with no SK_Delay, and all of a sudden they find an issue, maybe its has to do with some piece of the object. In my case it is the RichText control.

However, I am not saying that all RichText controls have issues or will cause any problems. It is all I can see from where I'm sitting.

-Hope this Helps someone.

-Love Macro scheduler (it's the best/most fun tool I've ever used).
Love Simple!! "Simplicity means the achievement of maximum effect with minimum means" - Dr. Koichi Kawana, Architect, designed the botanical gardens

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts