KM for Safari forms

Can anyone point me to a tutorial on how to approach using KM to fill out forms in Safari?

For example, a macro that opens a new Safari window, opens a URL, waits for the page to load, enters login credentials, clicks Go, goes to a specific link in the site, fills out specific fields in forms on that page, and clicks Submit?

Does this all have to be done with searching for onscreen images, or is there a better way to get KM to recognize what to click on in Safari, intelligently?

If anyone's done it on YouTube, or in other tutorials somewhere, I would love to see someone's workflow.

Thank you!

KM Wiki. It mainly shows examples with Chrome (for whatever reason), but I think many of the infos should be applicable to normal browsers as well.

No. The things you are referring to are last-resort solutions. The desired solution is to access your target app via AppleScript or via KM actions (which, under the hood, usually are AppleScripts or ASOC scripts).

If this fails, you usually try to target your app via Accessibility Scripting, that is, targeting GUI elements via AppleScript via the the Accessibility UI. (Sometimes called "GUI scripting").

Only if this fails also, you would apply heavy artillery like "Scanning for Onscreen Images" or similar. Last resort, definitely!

So, TL;DR for the moment:

  • Get a grasp of how KM works, and (optionally) of how AppleScript works.
  • The community here is pretty good and forgiving, so don't be shy.
  • Write a macro (or a macro attempt) and post it here.

I hope this helps you a bit to grab the concept of KM and scripting on the Mac.

– Tom

This tutorial by @philippe is several years old at this point, but it's very comprehensive and still applies to KM 8: http://flipmartin.net/software/keyboard-maestro-6-browser-control-part-1