Jump to content

Hotkey to insert text then press 'return'


Recommended Posts

Simple question I'm sure, but I'm new to workflows so a little help would be sincerely appreciated! How would I create a workflow that would allow me to specify a hotkey (e.g. Shift+Cmd+5) that would insert a piece of text and subsequently press the 'Return' key? Obviously I would make sure that my curser was in a text field prior to pressing the hotkey?

 

For example, if my Mom texts me via iMessage, and after ensuring that my curser is in the reply field, I press Shift+Cmd+5 which then inserts the text "not now, I'm busy" and subsequently presses the 'return' key to send the message? LOL

 

Thanks!

Link to comment

Create a hotkey and connect it to a "run script" (set the language to AppleScript) and use this:

tell application "System Events"
    keystroke "Hi mom, I'm busy"
end tell

 

Then connect it to a "Dispatch Key Combo" with the Enter key.

It should look something like this.

 

Note: I used Ctrl+Q as an example since Shift+Cmd+5 is a system hotkey for screenshots I believe.

 

1160208539_ScreenShot2022-02-08at2_50_53.jpg.c0efc5032cb8c6b2e8fdb1ed270cd4c2.jpg

Edited by goerwin
Link to comment
On 2/8/2022 at 2:11 PM, m021478 said:

Simple question I'm sure, but I'm new to workflows so a little help would be sincerely appreciated! How would I create a workflow that would allow me to specify a hotkey (e.g. Shift+Cmd+5) that would insert a piece of text and subsequently press the 'Return' key? Obviously I would make sure that my curser was in a text field prior to pressing the hotkey?

 

For example, if my Mom texts me via iMessage, and after ensuring that my curser is in the reply field, I press Shift+Cmd+5 which then inserts the text "not now, I'm busy" and subsequently presses the 'return' key to send the message? LOL

 

Thanks!

So I do something similar but for regular searches in gmail, but would work for what you need. 

something like this https://github.com/pearcenuk/Alfred-public/tree/main/reply_in_imessage

 

will reply to whatever message you have the input highlighted
2090801035_2022-02-09at11_55.png.510f76cb75b25d7229030332c987f285.png

 

From anywhere will open messages and send the reply to the last received msg.

2022-02-09 at 17.04.png

Edited by Pearcen
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...