Jump to content

Hotkey workflow to add cc: in Gmail in Chrome


Recommended Posts

Hi! I admit I am new to Mac and Alfred. 

 

Rather than using something like Keyboard Maestro, I've already bought Alfred and just need this:

 

I'd like to press a hotkey (so hotkey initiated workflow I believe) and have it:

 

Send r to gmail to reply to the message

Delay for the reply window to appear

Press Command-Shift-c to go to the cc: field

Enter example-email@domain.com in that field

Enter, Tab Tab to return to the editing window

 

I've looked at some of the other applescript workflows here, and I just can't get anything to activate. Running Maverick on new Macbook pro 13 retina

 

Thanks for any tips that you can offer!

 

Rick

Edited by rickthrivingnow
Link to comment

Hi! I admit I am new to Mac and Alfred. 

 

Rather than using something like Keyboard Maestro, I've already bought Alfred and just need this:

 

I'd like to press a hotkey (so hotkey initiated workflow I believe) and have it:

 

Send r to gmail to reply to the message

Delay for the reply window to appear

Press Command-Shift-c to go to the cc: field

Enter reply@thrivingnow.com in that field

Enter, Tab Tab to return to the editing window

 

I've looked at some of the other applescript workflows here, and I just can't get anything to activate. Running Maverick on new Macbook pro 13 retina

 

Thanks for any tips that you can offer!

 

Rick

 

Please remove your email address! If you don't, your address will be found by spam bots and you will begin receiving lots of junk mail!

 

Consider replacing your actual email address with the text "<my email address>"

Link to comment

Hi Tyler, My email addresses have been out on the internet long enough that I am virtually on every spam list known to man and machine. So I don't even think about it. I removed it to make for a more suitable example. Very little spam makes it all the way to my gmail inbox, though....

 

Any ideas on the workflow?

 

Thanks,

Rick

Link to comment

The script makes total sense to me, and fit along the lines I was experimenting with. AND, I cannot get it to trigger.

 

Workflow has line connected. Tried all kinds of different trigger keys, f7, Command-F7, Ctrl-Shift-C, whatever. Nothing occurs.

 

I can use snippets fine... Just doesn't seem to send keystrokes.

 

This is a Mavericks machine. New. Not sure if there are any settings somewhere I need to tweak to allow the applescript to send keystrokes?

 

Thank you so much for the draft. At least I know it isn't just my code <smile>

 

Rick

Link to comment

I set my workflow to use the hotkey Cmd-Opt-K and everything worked great. I'm on Mavericks, too; Mac OS X 10.9.2 (13C64)

 

Just to make sure we're on the same page:

  1. You downloaded the workflow and installed it
  2. You set a hotkey in the workflow's hotkey object
  3. You pressed your selected hotkey with Gmail open and a conversation selected
Link to comment

All three steps above, yes. I even remapped to your hotkey. Conversation selected. Press hotkey and nothing. 

 

So weird...

 

I hadn't run any other workflows so I created one from the example to use a hotkey to open a URL in the default browser. Worked perfectly.

 

I wonder whether there is an nsapplescript issue where it just isn't getting run. Admittedly, I am poking in the dark. 

 

Rick

Link to comment

All three steps above, yes. I even remapped to your hotkey. Conversation selected. Press hotkey and nothing. 

 

So weird...

 

I hadn't run any other workflows so I created one from the example to use a hotkey to open a URL in the default browser. Worked perfectly.

 

I wonder whether there is an nsapplescript issue where it just isn't getting run. Admittedly, I am poking in the dark. 

 

Rick

 

I didn't look in it extensively but I would tinker around with the delays and see if that helps. If it works for Tyler, I bet that's the issue.

Link to comment

It's not delays as far as I can tell...

 

I simplified it down to this:

 

on alfred_script(q)
delay 2.5
    tell application "System Events"
keystroke “reply@thrivingnow.com"
end tell
end alfred_script
 
I tried this in Chrome anyplace, and also in TextWrangler. There is no reaction at all from the system. No pop-up, nothing. 
 
I am wondering whether my new machine has some security issue blocking things. I read this article:
 
 
And I went to Security and allowed AppleScript Editor, Applescript Utility -- they had been off. This made no difference in behavior, alas.
 
Dragged and dropped Alfred 2.app -- activated that there, and also no change in behavior.
 
Changed around hotkeys again, and still... nothing anywhere.
 
Hmmm.... any other clues or things I might test?
 
Thanks so much...
 
Rick
Link to comment

OH JEESH!

 

So... when I changed the email address using the Alfred workflow editor, the leading " changed to a fancy quote:

 

on alfred_script(q)
tell application "System Events"
-- Trigger reply
keystroke "r"
delay 0.5
 
-- Focus cc: field, type email
keystroke "c" using {command down, shift down}
keystroke new-email@domain.com"
 
-- Return, tab, tab
key code 36
key code 48
key code 48
end tell
end alfred_script
 
Which of course doesn't result in any VISIBLE error, just nothing happening with the entire script.
 
How do I turn off the change from " to fancy quotes that happens there? Thanks for the help, guys!
 
Rick
Link to comment

 

OH JEESH!

 

So... when I changed the email address using the Alfred workflow editor, the leading " changed to a fancy quote:

 

on alfred_script(q)
tell application "System Events"
-- Trigger reply
keystroke "r"
delay 0.5
 
-- Focus cc: field, type email
keystroke "c" using {command down, shift down}
keystroke new-email@domain.com"
 
-- Return, tab, tab
key code 36
key code 48
key code 48
end tell
end alfred_script
 
Which of course doesn't result in any VISIBLE error, just nothing happening with the entire script.
 
How do I turn off the change from " to fancy quotes that happens there? Thanks for the help, guys!
 
Rick

 

 

:lol: I'm happy you found the issue!

 

The smart quotes issue is a bug in Alfred v2.1.x and below. This bug is fixed in Alfred 2.2 (currently available as a prerelease).

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...