how to capture backslash for a variable

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

how to capture backslash for a variable

Post by mfauzim » Tue Mar 02, 2010 10:02 am

I have a code as below

Let>VAREXPLICIT=1
Let>LoginId=TMMASTER\s10780
Press alt
Send Character/Text>u
Release alt
send>%LoginId%

when execute loginId=TMMASTER\s10780, ms assign loginId with only TMMASTER. How can I make sure ms assign TMMASTER\s10780 to loginID

Thank in advance

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Still Error

Post by mfauzim » Tue Mar 02, 2010 10:18 am

I have changed to script as below:

let>backslash=\
Let>LoginId=TMMASTER%backslash%s10780
Press alt
Send Character/Text>u
Release alt
wait>1
send>LoginId


when view in watchlist, login show it has been assign TMMASTER\s10780 which is correct.
But when send>LoginId, when is send to the text box is only TMMASTER, ms omit the \s10780.

Is this a abug and how to work around it.
I am using ms 10.1.21

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

Post by Marcus Tettmar » Tue Mar 02, 2010 10:39 am

I can't replicate with Notepad. This works fine:

Code: Select all

Let>VAREXPLICIT=1
Let>LoginId=TMMASTER\s10780

SetFocus>Notepad*
Send>%LoginId%
Must be something to do with the app you are sending to?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Still Error

Post by mfauzim » Tue Mar 02, 2010 12:45 pm

I am trying to login into ms outlook

below is the new code

Let>VAREXPLICIT=1
Let>LoginId=TMMASTER\s10780

//SetFocus>Notepad*

SetFocus>Connect to SMSGVS32.tm.my
//let>backslash=\
//Let>LoginId=TMMASTER%backslash%s10780
Press alt
Send Character/Text>u
Release alt
wait>1
Send>%LoginId%
wait>5


The output on the screen is TMMASTER\[/img]

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Post by mfauzim » Tue Mar 02, 2010 12:45 pm

I am trying to login into ms outlook

below is the new code

Let>VAREXPLICIT=1
Let>LoginId=TMMASTER\s10780

//SetFocus>Notepad*

SetFocus>Connect to SMSGVS32.tm.my
//let>backslash=\
//Let>LoginId=TMMASTER%backslash%s10780
Press alt
Send Character/Text>u
Release alt
wait>1
Send>%LoginId%
wait>5


The output on the screen is TMMASTER\

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

If cut and paste it works

Post by mfauzim » Tue Mar 02, 2010 12:55 pm

if I used manual copy and paste. it correctly paste into the outlook login as below.

TMMASTER\s10780

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

Post by Marcus Tettmar » Tue Mar 02, 2010 1:59 pm

Can you show us a screenshot of the outlook login?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

How to upload png file

Post by mfauzim » Tue Mar 02, 2010 3:57 pm

Sorry I cannot find how to upload image to the forum. Appreciate if you can guide.

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

Uploaded Dialog Box Picture

Post by mfauzim » Wed Mar 03, 2010 5:34 am

I uploaded the picture at the following url

http://www.flickr.com/photos/48046529@N03/4403386176/

mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

I found to solution

Post by mfauzim » Wed Mar 03, 2010 8:36 am

The above problem only occurs when I do debug/trace.
But when I compile into exe and run the script using exe,
the program input correct TMMASTER\s10780 into the text box

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

Post by Marcus Tettmar » Wed Mar 03, 2010 9:07 am

The debugger is probably steeling focus back. Try disabling Refocus Windows under the debug menu.

At least it works when run live!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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