Issue with creating Action to input "c" keystroke to Compose new message in Gmail within macro

I'm trying to create a macro for the aforementioned process, but I've already hit a snag on the second Action!
I've set the first action to Open URL which works fine.
But for the second I am unsure of the correct way to input the keystroke c (shortcut for composing a new message in Gmail). I have tried adding the Action Type the "c" keystroke (simulate keystroke) but all I get upon testing after adding this is a "bump" sound letting me know that the macro isn't working, with no response from the macro at all.
What action should I use to input the "c" key so that I can Compose a new draft message in gmail and move on to the next Action in the macro?

Thanks :slight_smile:

I would also use a Keystroke action.

Have you tried the macro with only the Keystroke-“c” action while the cursor is in a normal text entry field? (For example an open and frontmost document in TextEdit with the cursor in the text.)

If you get the bump sound also there, then something is wrong. Maybe permissions (see this post).

Hey Tom,

I created a new macro using just the "Type the c keystroke" Action, which generates a bump when no application selected (of course) but works fine when cursor is within a text window.

However I still don't know why the macro previously discussed won't work in its entirety... when I added the "open a url" part and tested it that worked fine, but as soon as I added the "type a keystroke" part it just gives me a bump sound and doesn't work. It seems the two Actions work fine on their own but not in sequence.... I have attached an image of how the macro looks.

EDIT: now I'm even more confused... upon closing then reopening KM, I find that instead of getting a "bump" sound after having tested this macro (by using the "run" button at top of screen), with no Actions implemented/response from KM, this time the behaviour is different: the second Action (to compose new message in gmail) doesn't seem to respond at all- no bump and no action; when triggered, the URL in the first action is opened and that is all, nothing else happens, as if the second action doesn't exist.

Now that you know that the Keystroke action basically works (the test with the text field), you should test it with your target (the Gmail inbox) frontmost, not with KM Editor frontmost.

If your screenshot shows the whole macro, then I would put some kind of Pause action after the Open URL action, so that the inbox is actually loaded when KM presses “C”.

I would also make sure that the browser is frontmost (Activate Application action), otherwise the keystroke may “land” elsewhere. (When you run the Keystroke “C” action and there is not an app frontmost that can “receive” the keystroke, you will get a bump sound.)

Correction: It seems the Open URL action already brings the browser to the front, so an Activate Application action is probably not necessary.

With Safari, this works for me (without the Pause it doesn’t):

New Message in Gmail Inbox <1113 200223T044617>.kmmacros (3.0 KB)

If the inbox is still not ready when the Keystroke comes, then enable the second Pause action too.


Ahh I see, I didn't realise Actions were time-sensitive; I was looking at it from a linear viewpoint i.e. "once this Action is completed, then the following will be implemented", failing to realise that KM doesn't know to "wait" until an action is finished before another should implemented (hence the "wait" action). Would be cool if it did though!

Yes, this is the way it works (unless an action is set to Asynchronous Execution). The action is: “Instruct the browser to open a URL.” But when the action is completed, it doesn’t necessarily mean that also the browser has finished its work; and the browser doesn’t tell KM when it has finished.

With actions that “happen” inside KM itself, for example replacing text in a variable, you don’t need Pause actions.

1 Like