Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Keystrokes in Web Viewer go VERY Slowly

Featured Replies

So... after a lot of trial and error, I finally have something working in the Web Viewer. The task I'm doing requires me to go to multiple web pages, tab through some fields, enter data in a field, and then press a button. Some other things happen, but that is the gist of it.

I have to tab 29 times to get to the correct field, and then I have to enter a 4 digit number (or something similar). Each of the tabs and each of the digits seems to take a bit more than a second to happen, which is agonizingly slow. I'm wondering if there is any known way to speed it up.

Here is the AppleScript that I've put into the Perform AppleScript command:

"--this script assumes that we're already ON the web page where we can add an item to our wanted list¶" & 

"set LegoRecordID to " & gracelego::ID & " as string¶" & 
"--this sets a local variable in AppleScript to SetID, unfortunately have to do quantity later, had trouble in AppleScript¶" & 

"tell application \"System Events\"¶" & 
"   repeat 28 times¶" & 
"      keystroke tab¶" & 
"      --this gets us to the right input field so we can input the ID¶" & 
"   end repeat¶" & 
"   repeat with n from 1 to length of MyRecordID¶" & 
"      keystroke character n of MyRecordID¶" & 
"      delay .01¶" & 
"      --doing it this way because it seems like it sometimes drops a number all at once, add delays if nec¶" & 
"   end repeat¶" & 
"end tell¶" & 

""

This definitely used to execute faster in older versions of FM, but in 17 (and 16 and 18?), it crawls. :(

Is there a better way to write this code?

Also, it seems like certain urls won't load into the Web Viewer unless I am already on the correct domain. I.e., when I'm loading a new page into the Web Viewer, if I am already on a page in the same domain, then the new one will load. If I'm not, then it won't. Obviously this is a different problem, but I'm mentioning it here in case it is somehow related.

Thanks in advance for any help!

  • Author

Bump... no ideas? Anybody? I'd be a grateful gorilla for some expert assistance...

I have to wonder if there isn't an API to send the data instead of trying to simulate a user typing it in...

  • Author

That would be awesome, but I don't know of one. I think there is something from Monkey_Somebody softward, but it's not free and I'm not sure how it works. Still, sending tabs to AppleScript should be dead simple; not sure why it slows to a crawl. :(

No, we're not talking about the same thing.  MonkeyBreadSoftware (MBS) is a plugin and I'm sure it can also automate keystrokes to simulate a user typing in stuff.  What I am talking about is an API provided by the web site / service that you are sending the data to.  It would be strange if the recipient does not have an API to send the data to in either JSON or XML format.

FM is particularly good at this kind of integrations.

  • Author

Ah, ok. I think that they do have an XML option, but unfortunately it is for making new lists rather than editing an existing list, and the latter is what I'm trying to do. :(

  • 1 year later...

Try and look under the hood of this webpage and view it's source html.

See if you can find the ID="???" of the field you want the data to be entered in.

Depending on the complexity of the webpage source code, this could range anywhere between fairly easy to find to absolutely impossible.

If you are lucky and find the ID, I would speculate that a little javascript/jQuery code inserted and triggered in your webViewer might be able to change the input value.

Possible javascript/jQuery off the top of my head (after adding a reference to the jQuery library in your javascript):

$('document').ready(function(){
   $('#theIdOfMyDesiredField').text('the auto-filled value I want to insert');
}

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.