Keyboard Maestro (v9) to be used for Office 365 logins


I need to be able to login into 2 different O365 tenants. This is a bit of a pain, since the login window is the very same - and based on your identity, you will be “redirected” to your proper O365 platform.

So if I type, I can chose between (at least) 2 different identities to login with.

How can I use Keyboard Maestro to pick one identity over the other as part of the macro?

You’re logging in via a web browser, correct?

There may be a way to do it via JavaScript, but it would require looking at the HTML to see if you can find something you can “target”.

If you can “View Source” and find the relevant section and post a snippet of it to the forum, that might help. Pro tip: put three “backticks” (this --> ` ) before and after the HTML you paste in, and it will format it

like this
which will be easier to read

The 3 backticks need to be on a line by themselves to work that way.

Does the portal always look the same?
You may be able to use the “find image” option in KM to find, and then select, the right identity.

You could:

  • ask for input on which to select
  • Find image on screen
  • then use the “click on image” action to click the right one

just an idea…

It is a German tutorial, but just watching the video is pretty self explanatory:

He even goes the extra mile to open 1Password, wait for the TouchID unlock, if it isn’t unlocked already and grab the login data from there. :ok_hand:
On his channel there also is a version without 1Password that only uses the macOS keychain.

Alexander’s videos are very good! I forgot he made this one, thanks for reminding me.

1 Like