Jump to content
Macro Express Forums

Using Macro Express through a VPN


Benglian

Recommended Posts

Hi,

 

I'm new to the forum, still getting my head around ME.

 

My work environment involves moving between local resources and a VPN where the database is stored. Can I use ME to, for example, copy a variable from my local environment, then paste it into a text box on within the VPN?

 

I work on dual monitors, and regularly need to move data between the two environments, is this possible?

 

I also work within two setups, one at home and one at work with monitors of differing resolutions, and I still didn't find out how to select a link in a web page when the page dimensions and the location of the link can be variable.... I'm sure working with web pages is covered somewhere, but I didn't find it yet.

 

Any hints welcomed.

 

Thanks

Link to comment
Share on other sites

Can I use ME to, for example, copy a variable from my local environment, then paste it into a text box on within the VPN?

Yes. Macro Express is perfect for copying stuff between two environments.

 

I also work within two setups, one at home and one at work with monitors of differing resolutions, and I still didn't find out how to select a link in a web page when the page dimensions and the location of the link can be variable.... I'm sure working with web pages is covered somewhere, but I didn't find it yet.

Here are three suggestions:

 

1. Use the Variable Set From Misc: "Name of Machine" into %ComputerName% command to get the name of the computer. Adjust your macro based on which computer is running.

 

2. There are commands to get dimensions of your screen, monitor and desktop:

 

Variable Set Integer %ScnWidth%: Set to the Screen Width

Variable Set Integer %MonWidth%: Set to a Monitor's Width (1)

Variable Set Integer %DesktopWidth%: Set to the Desktop Width

Variable Set Integer %ScnHeight%: Set to the Screen Height

Variable Set Integer %MonHeight%: Set to a Monitor's Height (1)

Variable Set Integer %DesktopHeight%: Set to the Desktop Height

 

3. Have your macro 'find' something on the web page: Text Type ctrl-f, then tab to the field containing information you need.

Link to comment
Share on other sites

 

3. Have your macro 'find' something on the web page: Text Type ctrl-f, then tab to the field containing information you need.

 

I have written many Macro Express scripts that do this, so I can offer a few caveats.

 

1. The approach is not 100% reliable, but can be reliable enough.

 

2. The method never works on images of text. However, it can be made to work by searching for nearby text, and then either tabbing or back tabbing to the target., something like this:

 

<Ctrl><f> // Search on this page
Sign in<Enter> // Text to search for
<Esc> // Cancel search
<Tab><Tab><Tab> // Navigate to Log off button
<Enter> // Activate Log off button

 

3. You will have to settle on one browser. IE, Firefox, Chrome, Opera, etc. use slightly different strategies for selecting and activating links in this way. For example, in Firefox, there is a command that searches for links only. Your program settings, plug ins, add ins, etc. can radically alter how you search and select.

 

4. It is usually best to start searching at the top of a page. However, I know of no 100% reliable way to do this if you have already interacted with a page. I tend to click somewhere close to the left edge boundry (where there are no clickable objects), and then type <home> to move focus to the top of the page. Then Ctrl f.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for both these responses, they are very helpful.

 

With regard to selecting a browser, and sticking with it;

 

I currently (mostly) use chrome. As I understood it the 'Wait for web page to load before continuing' ME command only works in IE. Is this correct?

 

Does this mean that if I want to click a link, then have ME wait for that page to load before proceeding, I have no option but to use IE?

Link to comment
Share on other sites

The wait for web page to load only works with IE, and even there, is not 100% reliable. Sometimes, a delay of a second (or two or three) must be added afterwards. (A guess: the command works as advertised with HTML pages, but not when JavaScript has been added to the mix.)

 

You always have the option to use other browsers. However, you will have to create your own code to wait for pages to load. The easiest way is to add a delay. How long a delay? With the vagaries of the internet, it's impossible to know for sure. A 15 or 20 second delay will likely be enough to cover most circumstances, but would be total overkill on occasions when pages load in less than a second.

 

There have been discussions on this forum about macros that monitor pixel colour changes to infer when a web page is completely loaded. I have used this technique with Firefox, and it is fairly reliable provided l don't mess with the appearance of the browser, e.g., adding toolbars, history panes, etc.; or change Window settings related to resolution, size and colours of UI components (menus, window borders, etc.). These macros may need to be updated when a new version of the browser is installed, as the appearance of the UI may have slightly changed.

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