Jump to content
Macro Express Forums

Newbie Question with Remote Desktop


Recommended Posts

On the laptop, it works to just say "Activate Window". But nothing works over RDP. The macro really is pretty simple. Opens the "Write" menu, opens a template, copies the template, opens the copy for editing, pauses for user input, merges the document to a group of people and emails it. Works perfectly on the laptop but not on the remote. I have tried several things that others have suggested, and I can create (on the remote) a macro that opens Notepad and types into it, but trying the same thing with Act! does nothing, as you see from my replies above. I'm not exactly sure what you mean by "controlling focus", other than I activate the window.

Link to comment
Share on other sites

If a window goes out of focus, it can't receive input. Only one window at a time can be focused in Windows. I've had this problem often and this is why it's important you ensure the window you want is focused before typing or whatever and not some other window. Also invisible windows can take focus and your window might even look like it has focus when it doesn't. I've known many utilities that are good at invisibly stealing focus. This is why you need to do Windows Activate commands before inputting. 

You should also scope your macros to the desired window or program to avoid it firing in the wrong application. 

Both of these topics are covered in the help file. 

Link to comment
Share on other sites

If you TextType the active control on the focussed window received. One reason I think Windows Control commands are superior is that they don't need to be focussed. In fact the window can even be invisible. By using the Windows Control commands instead, one eliminates all the constant checking to see if the desired window is focused. Also eliminates knowing all the shortcut keys, tabbing order, et al. 

Link to comment
Share on other sites

Yes, both MEP and the macro are running on the remote, NOT through the RDP connection. MEP is running in Administrator mode. The first command is to Activate Window. Scope is set to that specific window. Second command is <ALT>i . That should open the Write drop-down menu, but nothing happens.

Link to comment
Share on other sites

Hmmmm... Maybe try some <Alt> commands in other applications like notepad?

Maybe add before the ALT+i a command a debug to record what window is active? Or maybe a beep.

Are you seeing the same problem with VNC?

Link to comment
Share on other sites

Logging into the remote computer with RDP, I can create a macro that activates the Notepad window, opens the File dropdown (ALT-f), types the letter n, types the word "Test", ALT-e and then types a to select all of the "Test" text. Works perfectly. Tried a 3-line macro to do similar typing in Act! (see below) and it neither runs in RDP or VNC.

 

I don't see a debug choice to record what window is active...among the "catch error" options

Act! & MEP Windows VNC.PNG

Link to comment
Share on other sites

Did you try my suggestion about your Delay commands?


Try adding a Wait for Window Title afer activating Act!

 

Try adding a 0.1 s delay after typing <Alt + I>.

 

Try using Waits for Text Playback after the TextType.

 

Try using mouse move and click commands.

 

Is it only <Alt + I> that fails?

 

Best to confine all subsequent example macros to this single issue, as you’ve just done in your lat post.

Link to comment
Share on other sites

Yes, I added Delay and that doesn't seem to fix the problem. It looks as if for some reason, the Act! window never gets activated, so nothing works. I created a sample macro using the commands you suggested (posted below) and ran it while logged in via RDP, and again logged in via VNC Viewer, and neither one clicked on the Write command. So it's not just <Alt+i> that fails...no command works because the window never gets active as far as I can tell. But I can't figure out why.790449307_TestingperTerrypin.PNG.b0e3cd602f99eb6bbc18a1f3c00c8eeb.PNG

Link to comment
Share on other sites

Something else could be stealing focus. Add a command in there to grab the topmost window title when this runs and display it in a message box. Make sure it's Act. 

 

So much simpler using Windows Controls. 🙂 JK. 

Link to comment
Share on other sites

That sounds like a problem if the whole main area is a control. It's likely a web browser control or a UWP component in an Winform program or a UWP app. Maybe WPF. In any case these are difficult for MEP to control. I've done macros for such apps on several occasions any it was frustrating. I got the feeling that the main form (window) can be focussed, but not the control. You see this sometimes with web browsers. They're active but you have to do something in them like a blind click to activate the component therein. Plex for Windows desktop was like this for me and I finally gave up trying to make macros work reliably. Since it's a chromium control (Chrome web browser rendering engine) I snooped the HTTP requests and learned to do my automation that way. It's not something I recommend for you, I'm just demonstrating how much problem I've had with apps like this in the past and went to extremes without MEP to do the automation. 

Link to comment
Share on other sites

It is strange. I can't think of any reason it wouldn't work remotely. It's difficult for me to help you with this. This is one of those things I'd have to get my hands on to play with.But know that I've written hundreds of macros that run on a remote machine and are accessed via VNC or RDP. Also VNC uses the console session. If you're there, you see it on screen. I've never seen a macro fail like that on a machine I'm accessing via VNC. I think it's unlikely that the remote utilities are to blame. I'm guessing it's something on that remote computer. Maybe some security software. I would try installing ACT on another new machine with nothing else on it and see if it has the same problem. 

 

Link to comment
Share on other sites

Update: I think I have figured out why I've been having so many problems. It turns out that Act! has two platforms...one is the standalone version which installs on various workstations and then these workstations sync with the main server to keep the database updated. The other platform is called Act! for Web, and even though it can be accessed via the web, it can also live on an individual machine, and the interface looks exactly like the standalone version.

 

I have the standalone version on my laptop, which is where I created the macros, but on the remote server, where I am trying to run them, the Act! for Web platform is installed, and lots of things are different...Winforms for example, which explains I think why I couldn't get controls to work. I have solved the problem by installing a standalone version on a different machine at the remote location, and giving RDP access to it for the person who needs to use the macro function. I am just about to test that capability and will report.

 

In the meantime, although I want MEP to start when Windows starts, I want to disable the two screens that popup each time I log in...there is a hyperlink that says something like click here to disable these screens from displaying, but that neither works nor is there a preference or option I can find to disable them from popping up. Can you tell me how to do that?

Link to comment
Share on other sites

Glad to hear you figured it out. That is what it sounded like, but you said it was the same program and worked on the remote machine when the remote machine was run in a local session. 

 

You can use a macro to close a window by title as soon as it appears. Create a new macro and choose a Window Title activation and use a Windows Close command. Alt+F4 usually works as well. 

Link to comment
Share on other sites

Just when I thought I had it figured out, and after I had been editing the macro several times to get it to work exactly as planned, now all of a sudden it won't even activate the first window!

The first two command are "Window Activate", followed by a short delay, and then "Window Resize". If I place a "Macro Stop" right after the second command, do a test debug, nothing happens! It's as if MEP doesn't even know the program is running. Any idea what could cause that to suddenly happen, when the macro seemed to be functioning almost perfectly a few minutes before?

Link to comment
Share on other sites

It's as if Act! doesn't even recognize that MEP is running! I tried to create a test macro...get control of the Act! window and have the mouse move there. I make a variable called "Act! Window", activate the locator utility, select the control area...and then when I try to save it, a message pops up saying "You must select a control!" So MEP is not seeing the Act! window at all. Any ideas why that would be?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...