And sorry if this has been asked several times before, but I couldn’t find an answer to it.
I’m looking for a way to capture (text) highlights from articles I’m reading online - either with a keyboard shortcut or an Alfred workflow.
The action should capture whatever text I have highlighted, create a new draft with the next and also include the URL of the webpage where the text is captured from.
How do I make that?
Drafts has a share extension on the Mac which can do this in Safari, just as it can on iOS. Click the share menu in the Safari toolbar, then Drafts. You may have to select “More…” and enable the Drafts share extension.
Catalina (10.15) note: As of the time I am writing this response, macOS 10.15.3 still has a bug that prevents third party share extensions which integrate with Safari from being enabled. They simply do not appear in the list of share extensions in System Preferences. This has been reported to Apple by multiple sources, hopefully they will resolve soon.
That is exactly what I was looking for. Thanks.
But - there is always a but - is there a way to get it to work in other browsers (Chrome) both on macOS and iOS?
Thank you so much for this. You have saved me a lot of trouble. I was beginning to think it was a problem with my setup that the Drafts share extension was nowhere to be found.
I don’t use Alfred, so I can’t tell you how to use it to run an AppleScript, but this is (approximately, at least) the AppleScript you can run:
tell application "Google Chrome"
set theURL to URL of front window's active tab
get theQuote & linefeed & linefeed & theURL
This gives a plain text result, with the quote followed by a blank line and the URL. You can jazz it up with Markdown or HTML as you see fit.
As you can see from the last line, the output is left just sitting there. I don’t know how to make a new draft directly, as there appears to be no AppleScript dictionary for Drafts.
If I needed this ability, I would use Keyboard Maestro to run the script and paste the results wherever the cursor is (presumably in some text editor). Chrome doesn’t have to be the active app for it to work.
But I can’t get it to work properly… (my JS skills are very basic)
Well, I feel foolish for not thinking of using a URL scheme. This will work:
To @tf2 and @marsnielson’s points, I’m sure the same idea would work in a bookmarklet, but I’m not skilled enough at them to try.
One thing about this macro is that Chrome asks for permission to open Drafts every time I’ve run it. I suspect there’s a way to turn that warning off, but
- I almost never use Chrome, so it’s not worth it to me.
- The extra safety is probably worth the slight annoyance of having to give approval each time.
That is great… got it to work as a Alfred workflow.
In Chrome you can give permission to run Apple Scripts so it doesn’t show the warning
Thank you so much for you help!
Is there a way to change the format that it saves in? Right now it seems to be:
But I’d like something more like:
Then I’m surprised you don’t want Something like
[linktext - url](url)
as that would be the best of both worlds.
Sure, that’d be OK too. I’m curious if that is possible
On iOS, why does Drafts appear as an option under Share Extensions for some web pages but not others?
For example, when I click on share extension box at the bottom of Safari at this site, I see the Drafts app as one of the choices. But I do the same thing at this site and Drafts app is not available as an option.
Reboot your device. You are probably just seeing iOS 14 bugs with flaky extension registration, reboot should resolve.
- Open System Preferences.
- Select Keyboard.
- Select App Shortcuts.
- Select Shortcuts.
- Select “+” to create a new App specific keyboard shortcut.
- Set Safari as the app.
- Set the Menu Title as “File->Share->Drafts”.
- Set the keyboard shortcut to whatever shortcut you wish to use.
- Select Add.
- Close System Preferences.
In Safari, when you now press the keyboard shortcut it should trigger the share to Drafts as per the share template you have defined in Drafts.
Hope that helps.
@sylumer Thank you, this solution works perfectly.