Is this JavaScript?

Hi everyone,

I'm trying to figure out a source of web code. Does anyone recognize this code as being JavaScript?

If so, do you know of any definitive source to learn enough JavaScript that I can program KM to run this code? It is part of a form on a website I want to fill out.

I'm not wanting to become an expert in JavaScript ... just want to verify this is what I'm dealing with and the quickest route to learn enough about it to get KM to autopopulate this field.

Thanks!
Brandon

image

Not JS – just HTML web markup.

You would need to give a concrete example of what you are trying to do before anyone can really help you, I think.

Interesting!

Hmm ...

Yes, this is for a site that I have to input student notes into (I'm a college instructor). Here is how that form looks on the page:

image

I just can't figure out how to automate the KM script to automatically select the option I need. Even something like "click here" with the down arrow and picking a choice on the list doesn't work.


That is why I thought maybe it was JavaScript and I had to go after it another way.

Any ideas?

Thanks,
Brandon

I don't know JavaScript, and you might be able to select that with JavaScript, but you don't need to.

Try this:

  1. Load the webpage
  2. Press 'tab' to get to the drop down list
  3. Press 'V' to select the first "Voicemail" entry
  4. Press 'V' again to (hopefully) select the second "Voicemail" entry

If that works, then all you need Keyboard Maestro to do is automate "Press Keystroke" three times to mimic those three keys.

If that doesn't work, try other keystrokes to see if you can get the right drop down entry.

Thanks for the suggestion!

I forgot to mention that this DOES indeed work. I can do this manually and select the entry I want.

But when I first attempted this in KM, it doesn't seem to do anything. It almost seems like it ignores the V keystroke. Another reason why I thought something fancier might be behind that menu selection.

Any ideas on why the V keystroke wouldn't work in KM for that?

UPDATE: So it does recognize the first V keystroke. I can see the drop down list. But it seems to ignore any other V keystroke I have. It will pull the list up, but it won't scroll down the list to pick an entry.

But ... after the macro stops, I can manually hit V and it will highlight the first entry. Weird ...

Try adding a short pause between the keystrokes. Start with about 2 seconds, and see if that works.

If it works, you can try shortening the pause down to like 0.5 increments and try it again.

Oh my!!!! That worked! Don't know why, but who cares?! :smiley:

Thank you SO SO much for that!!!!

Here is one last challenge ... perhaps the window in the lower right of the pic is JavaScript? If I hit Tab, it skips over this box entirely. It is almost like it doesn't exist via tabbing. Any thoughts about this one?

Adding a slight delay is a good troubleshooting tip whenever KM seems to fail at something that works when you do it yourself.

KM can do stuff so fast that the computer sometimes isn't "ready" for the next command, especially something like keystrokes, which don't take long anyway.

That's probably not JavaScript either, it's probably just bad web-design. I think I saw a tabindex in the HTML you posted earlier. That tells the browser what order to go through the page when the user presses 'tab'. Whoever designed the page probably neglected to add the tabindex to the section that seems like it doesn't exist.

Unfortunately I'm not sure how to handle that with KM.

Try using the ‘click on found image’ Keyboard Maestro action. You will need a screenshot of the area you want to select and import that image into the action. Be prepared to experiment with larger or smaller screenshots and with the position of the mouse controls on the action. Good luck.