OnTheClock Posted September 7, 2017 Share Posted September 7, 2017 (edited) Hi all, I think this is probably simple, but is driving me crazy: I want to create a keystroke to add the url from a Gmail link to Pocket. I've tried both "Add URLs to Pocket" and "Pocket for Alfred" and neither does exactly what I need. "Add URLs" requires that I open the link or right click and "Copy Link Address" to get the URL into the clipboard before I save to Pocket. And "Pocket for Alfred" uses the Pocket website, not the Mac App. The Mac app adds a service to the right-click menu, called "Add to Pocket" but it adds the text not the link. I was hoping to just add a "copy link to clipboard" step to the 'Add URLs to Pocket' but can't figure out how to do it. Any help advice, comments, questions? Edited September 7, 2017 by OnTheClock Link to comment
Vero Posted September 7, 2017 Share Posted September 7, 2017 @OnTheClock Welcome to the forum! Could you please fill in your Powerpack email address in your forum profile? This is only visible to admins but allows us to confirm your Powerpack status. We'll then be happy to help you with this Cheers, Vero Link to comment
OnTheClock Posted September 7, 2017 Author Share Posted September 7, 2017 Done. Thanks. Link to comment
OnTheClock Posted September 12, 2017 Author Share Posted September 12, 2017 Still trying to figure this out. How about this work-around: Is there an script method of duplicating Chrome's "Copy Link Address" from the right-click menu? Thanks Link to comment
Vero Posted September 13, 2017 Share Posted September 13, 2017 @OnTheClock Apologies I missed your early reply! Thanks for adding your details to your profile At this point, I'm not sure how you'd do this (as it partly depends by what you mean by "a Gmail link", and how the Pocket workflows operate) so I'll pop this in the Workflows section to see if fellow users could help. Take a look at the Hotkey object, which can be used to grab the selected text in macOS to use as argument, which may be a starting point for you: https://www.alfredapp.com/help/workflows/triggers/hotkey/ Cheers, Vero Link to comment
OnTheClock Posted September 13, 2017 Author Share Posted September 13, 2017 Yep, this is my plan -- I just want to highlight a hyperlink in Chrome, press a hotkey that copies the URL into the clipboard and runs this script: ADDCLIP=$(osascript -e "get the clipboard") open -g pocket://add?url=$ADDCLIP echo $ADDCLIP I thought it would be super straight-forward, but I can't find a way to copy just the URL. Standard ctrl-C copies the link text in the clipboard, not the link URL. In Safari, I could add a hotkey to the 'Share' menu item, but Chrome doesn't have this. Instead, Chrome has a 'Copy Link Address' menu item. (See attached tiny screenshots). Thanks, Charlie Link to comment
deanishe Posted September 14, 2017 Share Posted September 14, 2017 If Chrome only puts text on the clipboard, there's not much Alfred can do. You could try simulating a right-click via AppleScript, but that's very error prone. Your best bet is provably a Chrome extension or a userscript. Also, your script is broken and shouldn't work properly. You need to URL-encode your argument. Link to comment
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