Jump to content
Macro Express Forums

Text Type (Simulate Keystrokes) suddenly causing problems in Google Calendar


Recommended Posts

I have been using Macro Express Pro for many years.  Just today, all of a sudden, a glaring problem has arisen that I have never seen before.  I use ME Pro to fill in data in new calendar events in Google Calendar.  The script I made tabs between fields (by Text Typing the Tab command), copying data and then tabbing down to the description field to paste the data into that field.  What has just started happening is that when the script attempts to tab into the "End Time" field, the field starts flashing like crazy and locks up.  If I tab into the field manually, it works perfectly.  It's only when the ME script tries to tab into that field that it freaks out.  Any suggestions?  It started doing this in ME 4, so I upgraded this morning to ME 6.   Still has the problem.

 

Thanks for any help.

 - Lyle Wood

Edited by lylewood
Clarity
Link to post
Share on other sites
  • lylewood changed the title to Text Type (Simulate Keystrokes) suddenly causing problems in Google Calendar

Macro Express scripts that interact with web content can be thrown off by changes at the code level. So if the developers of Google Calendar made a single, minor, behind-the-scenes amendment, your script may no longer work reliably.

 

It happens all the time. Fixing these kinds of problems comes with the territory. I've been forced to rewrite my MEP scripts for Hotmail (now rebranded Outlook.com) more times than I can count. The last time Microsoft "improved" the user interface, I was forced to start entirely from scratch. I tinkered with my new scripts for weeks before they were working reliably. Then I switched from Windows 7 to Windows 10, and instantly, half the scripts failed!

 

How to fix the problem you are experiencing? The first thing I would try is slow down the script. Add long time delays between steps. Sometimes Text Type works better when outputing text via the clipboard instead of directly, although that may not be appropriate if you're sending one <TAB> after another.

 

If you post the script that has started to fail, perhaps some of us can offer suggestions.

Link to post
Share on other sites

My first question is, is there another way to reliably move between fields in a program (Google Calendar in this case) other than the script tabbing from one to another via Text Type? 

 

I did try slowing the script down a lot, which didn't help at all.   It is only one field that is giving the problem.  Tabbing among all other fields via the script works fine.  

Link to post
Share on other sites

On a webpage, Tab and Shift + Tab are usually reliable ways to navigate field to field.

One of my favourite non-programmatic approaches is to search for a nearby label and then Tab (or Shift + Tab) into the target. I find Firefox offers the best search options, as there is the possibility of searching for hypertext links, only.

 

But searching for a target can be made to work in any browser. To jump the cursor into the “Hello World” field, do this (in pseudo code):


 

Quote


Type <CONTROL>f // Keyboard shortcut for Find. F3 might also work

Wait .3  // Usually needs a short delay

Type Hello World<ENTER> // Text to search for. Pressing Enter starts the search

Type <ESC> // Cancel the search

Type <TAB> // Tab into the field

 

 

Sometimes it's better to search for labels to the right of the target, and then Shift + Tab to reach the target.

 

There are other non-programmatic approaches, including searching for pixel colours, then moving the mouse pointer to the found pixel, and then clicking. This worked well in Windows 7 and earlier, but became extremely slow in Windows 10: maybe 100 times slower. I search for pixels less often than I used to.

 

If you understand the JScript, VBScript or HTA/HTML script languages, you can use the External Script feature. There are people who haunt this forum who have a good grasp of this approach, so ask if it interests you.

Link to post
Share on other sites

Thank you al for the responses and suggestions.

 

Here is a truncated version of the problem macro (attached).  The way it works is to open a Google Calendar (I use the weekly view mostly) and hover the mouse over the time slot you wish to make an appointment in.  (The complete version of the macro takes the calendar data and then goes to Filemaker and enters the calendar appointment into fields in my customer file.  Then it switches back to Google Calendar and completes entering the appointment on the chosen day and time slot.  It had worked perfectly for the past couple of years, until yesterday when it suddenly started glitching, as you can see from the truncated version of the attached macro file.  I disabled all the commands after the problem one, and also reduced the number of TAB keystrokes in that final enabled command from 22 to 2, so it can easily be seen that the problem is with the END TIME field.   Tabbing amoung all the other fields works fine.  It is ONLY the END TIME field that is the problem.  

 

 - Lyle Wood

GoogleCalendarTestMacro.mex

Link to post
Share on other sites

Can you tab through the misbehaving field? For example, if <TAB><TAB><TAB> is what you would normally do to navigate to the XYZ field, does <TAB><TAB><TAB><TAB> take you to the field to the right of it?

 

And if it does, how about this?

 

<TAB><TAB><TAB><TAB><SHIFT><TAB>

 

You've tried slowing down the script: but have you tried a more radical approach to putting on the brakes?

 

Repeat Start (Repeat 15 times)
  Text Type (Simulate Keystrokes): <TAB>
  Delay: 200 milliseconds
End Repeat

 

Link to post
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...