Macro Interferes with Windows

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
minchia
Newbie
Posts: 14
Joined: Tue Apr 28, 2009 8:33 am

Macro Interferes with Windows

Post by minchia » Tue May 05, 2009 12:54 am

Hi All, have written my macro and it seems to work ok. Issue is thou that due to it having parts that take a screen shot and compare it to saved BMP's, i loose my ability to cut/copy/paste and when i do get it to work, it screws with the macro. I use a few mouse cmd's as well and think me suing the mouse in my main screen is affecting the mouse int he macro screen.

i'm running the macro thru remote desktop so i can monitor it as it has a tendency to hang or get stuck.

Just wondering if anyone has had this type of issue and if so, have you resolved it?

Code below if needed. thanks

Code: Select all

Let>k=1
Label>start
Let>WSI_TIMEOUT=18.5
ReadLn>c:\\\PP5\\\OpenMsgAttachment\\\MsgAttachmentIDs.txt,k,line
StringReplace>line, ,,tmpline
If>line=##EOF##,finish
run>C:\PP5\OpenMsgAttachment\OpenMsgAttachment.exe %tmpline%
WaitScreenImage>C:\PP5\OpenMsgAttachment\MsgProg.bmp,20
send> ALT + o

WaitScreenImage>C:\PP5\OpenMsgAttachment\button.bmp,20
//WaitScreenImage>C:\PP5\OpenMsgAttachment\button2.bmp,20

If>WSI_TIMEDOUT=TRUE
GoTo>Main
else
GoTo>Main
endif

label>Main
PRESS ALT
send>fa
release ALT
    
WaitWindowOpen>Save As
wait>0.5

//choose the MSG extension
press tab
send>oo
release tab
press enter
release enter

//tab to filename
press Shift
send>tab
release shfit
send> C:\PP5\OpenMsgAttachment\MSG Files\doc%tmpline%
press enter
release enter
wait>1

//if file exists, override
IfWindowOpen>Microsoft Office Outlook, override

//close MSG file
press ALT
Press F4
Release ALT
release F4
wait>5

//close attachment
press ALT
send>e
Release ALT

label>override
press alt
send>y
release alt
press enter
release enter
wait>2

//endif

Let>k=k+1
Goto>start

label>finish
MessageModal>Finsihed.
Exit>0


gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

A few things to check.

Post by gdyvig » Tue May 05, 2009 1:25 pm

Hi Minchia,

I don't see any clipboard commands in your script, so I assume you mean the script is interfering with manual clipboard activity.

Check your Remote Desktop and your Macro Scheduler keyboard mappings for conflicts.

The script may be hanging because it can't recognize the windows in the WaitWindowOpen commands. Remote Desktop may be adding " - \\Remote" to the displayed window name. That can be fixed by wildcarding your window names by appending an asterisk.

It is also possible Macro Scheduler cannot see the window at all in the Remote Desktop - I assume Macro Scheduler is on the local desktop. Use View System Windows from the Scheduler or Editor menubar. Enter part of an expected window name in the Find field, see if the window is found or if the window name is altered.

Another way to find out what Macro Scheduler sees in the Remote Desktop is to use the WinList command. Set it to return visible windows only. If Macro Scheduler sees no windows, you will need to rely solely on Image Recognition to activate windows and syncronize your scripts.

Assuming your WaitWindowOpen commands are working, follow each one of them with SetFocus to ensure your keystrokes are sent to he correct window.



Gale

minchia
Newbie
Posts: 14
Joined: Tue Apr 28, 2009 8:33 am

Post by minchia » Thu May 07, 2009 5:29 am

Thanks for the info Gale. I've played around a bit more with the Wait settings and it seems to be alright now. i've had to have the Remote window just sitting open on another monitor and not minimize or close it. in doing this the macro has been running successfully for the last couple of days (the process it's running will last about 7-8 days).

i'll look into the keyboard info for both the macro and RDP once it's completed this task and i can devote more time to it.

thanks again.

Arthur

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