rickthrivingnow Posted March 6, 2014 Posted March 6, 2014 (edited) 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 March 6, 2014 by rickthrivingnow
Tyler Eich Posted March 6, 2014 Posted March 6, 2014 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>"
rickthrivingnow Posted March 6, 2014 Author Posted March 6, 2014 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
Tyler Eich Posted March 6, 2014 Posted March 6, 2014 Here's a workflow I threw together: http://cl.ly/3t0Y042I2M0P/download/Workflow%20Lab.alfredworkflow Let me know how it works
rickthrivingnow Posted March 6, 2014 Author Posted March 6, 2014 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
Tyler Eich Posted March 6, 2014 Posted March 6, 2014 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: You downloaded the workflow and installed it You set a hotkey in the workflow's hotkey object You pressed your selected hotkey with Gmail open and a conversation selected
rickthrivingnow Posted March 7, 2014 Author Posted March 7, 2014 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
jdfwarrior Posted March 7, 2014 Posted March 7, 2014 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.
rickthrivingnow Posted March 7, 2014 Author Posted March 7, 2014 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: http://www.macosxautomation.com/mavericks/guiscripting/index.html 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
rickthrivingnow Posted March 7, 2014 Author Posted March 7, 2014 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
Tyler Eich Posted March 7, 2014 Posted March 7, 2014 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 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).
rice.shawn Posted March 7, 2014 Posted March 7, 2014 (edited) The smart quotes issue is a bug in Alfred v2.1.x and below. That's why it's always great to write everything in a (plain)text editor and copy/paste! Edited March 7, 2014 by Shawn Rice
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now