Safari Extension for Drafts

I built a Safari Extension for my own use and some others might be interested. Basically it extracts the article from a page and creates a markdown draft of it.

https://github.com/ddegner/SafariToDrafts

Feel free to compile it yourself. If there is enough interest I might release the extension on the App Store.

I get a 404 error when trying to access the github repo. Perhaps it is set to private or has been removed?

I can not open that page on github. Error 404 :disappointed_face:

I get a 404 Error when going to the link you provided.

Still 404 error to provided link.

Very sorry, I forgot to change the repo to public.

It should work now: GitHub - ddegner/SafariToDrafts: A Safari extension for creating a draft out of a safari tab

I have been polishing the extension over the last month and submitted it to the App Store. I’ll update here when it is available.

It is my first time submitting anything to the app store so wish me luck.

6 Likes

I made it through the App Store process and the extension is now live!

Try it out here:

4 Likes

Hi David,

I downloaded from the app store (congrats on that), but I have not had a lot of luck building the extension, mostly due to signing issues. I will keep at it, but wanted to say thanks in the meantime!

1 Like

This is really neat. Thanks for getting it released!

2 Likes

Sorry about the code signing, I just spent a couple hours trying to set it up so it can easily be distributed and hacked on and didn’t succeed. I may try again tomorrow.

Code signing is complicated and frustratingly opaque. I will let you know if I figure it out too.

I just posted an updated the parsing function in the Cat Scratches extension. Now it does a better job or removing the unnecessary chrome around an article!

Fork, or share any bug reports on github.

3 Likes

Thank you for this @Degner

Thank you for this really great (and incredibly fast) Safari extension!

I have two questions:

  1. Is it possible to format the timestamp?
  2. Would it be possible to make the cat distinguish between scratching the complete page or just a selected excerpt by having a separate template for each one (and maybe even separate tags)? For the latter I would prefer just the content with a footnote containing the source, {content}[^1][^1:][{title}]({url}) ({timestamp}). While for the complete page it is # {title} {content} --- [{title}]({url}) ({timestamp}).

Very useful - I just installed the extension and I use safari by default - one click and directly into my drafts app - superb to be honest. Thanks. Sometimes such things make me feel - hey why hasn’t someone done this already - amazing stuff and thanks

1 Like

Glad you like it!

  1. I tried to make the timestamp format flexible by giving a lot of tag options. If you can’t combine them to the date style you like let me know and I can add a few more.
    {timestamp}
    {date}
    {time}
    {datesort}
    {timesort}
    {year4}

  2. I like the idea, but am afraid if introducing too much complexity into the extension. Let me think about it. If you want to vibe code that feature yourself though feel free to share it back on github.

Thank you very much for your reply.

Stupid me, I hadn’t spotted the little triangle in the settings and therefore hadn’t seen that you did include more than just {timestamp}. Still, to make it impeccable I’d love to have {day} and {month}, i.e. day and month without a leading zero. But I definitely could live without.

I guess you’re right. Thinking about it, the settings for a selected excerpt from a webpage with a footnote would make more sense in the PopClip extension for Drafts because PopClip pops up after selecting text.

Or is it possible to trigger the Drafts share extension (in the menu bar, not in the context menu, which ignores the settings for the share extension) by a keyboard shortcut? Then I could use one shortcut for Cat Scratches to get complete web pages and the same shortcut plus, say, Shift, for the Drafts to import an excerpt from a web page, both with their respective Markdown formatting. And probably all the extras of Cat Scratches are needed less for excerpts than for whole pages.

Like everyone, I just ran this extension through Claude’s latest model and it found some bugs. One of the main bugs was that it was dropping URLs from the body text. So I fixed it and made it an option to include links or not (defaulted to not).

Also I’m adding @suavito’s suggestion for more date formats.

Keep an eye out for the update soon!

Cat Scratches

2 Likes