Safari To DEVONthink plugin - to download

Being an Evenote convert I wanted to have a Safari plugin which will let me add the website as PDF to DEVONthink directly, without any bookmarklets and redownloading the page.

I’ve just implemented it. :slight_smile: Basically it works the same like “Print > Save to DEVONthink” feature but it’s easier to use - no need to go through the Print dialogs, just hit Cmd+Alt+P.

You can also use it for sites requiring login etc. For typical sites I rather prefer using web archives (Services shorcuts Cmd+) and Cmd+@ are perfect!) - web archives have web links, PDFs are just documents, no links inside.

Please note: you use the plugin ‘on your own risk’. The plugin hasn’t been tested on any other Mac than mine. It has been tested with Safari 4.0 only. And it’s kind of hack, just like Cosmopod, Evernote plugin, 1password plugin etc.

After installing you’ll get a new option in File menu called “Save to DEVONthink”. Its shortcut is Cmd+Alt+P. I was trying to add some commands to the contextual menu of Safari but it’s not that easy. It has already taken me 6 hours to do the current implementation :slight_smile:

And, oh, sorry - there’s no official installer. The install/uninstall procedure is described below.

Enjoy. Comments are welcome :slight_smile:

Installation

  1. Please download the archive to your Downloads folder. Download URL:

bbargiel.pl/SafariToDEVONthink.zip

  1. Please unpack it (by doubleclicking it).

  2. The folder SafariToDEVONthink will appear.

  3. Please quit Safari.

  4. Please open Terminal application (using Spotlight, for instance).

  5. Please type the following commands:

cd /Library/InputManagers
sudo mkdir SafariToDEVONthink
(type in your password)
sudo cp -r ~/Downloads/SafariToDEVONthink/* SafariToDEVONthink/

  1. Please start Safari.

The command should be visible in the File menu, right after ‘Save As…’

Deinstallation (in case of any problems)

  1. Quit Safari if running

  2. Please open Terminal application (using Spotlight, for instance).

  3. Please type the following commands:

cd /Library/InputManagers
sudo rm -R SafariToDEVONthink
(type in your password)

  1. That’s all. You can start your Safari now.

You may want/need to add these commands to the end of step 6 to ensure correct ownership/permission:

sudo chown -Rh root:admin /Library/InputManagers/SafariToDEVONthink
sudo chmod -Rh og-w /Library/InputManagers/SafariToDEVONthink

Hey, this is really nice! Way cool! Thanks for taking the time to code this.

It works for me and it’s certainly a nice shortcut (Leopard 10.5.7, Safari 4.0 5530.17)

One question, though: Can you briefly explain why the need to copy the file using Terminal rather than Finder?

@sjk: I get the following error message back in Terminal when inputting your second (change file mode) command:

chmod: the -R and -h options may not be specified together.

A quick look at the man pages shows the option to be -H rather than -h, which works fine.

Actually you don’t want the -H behavior of following symlinks, which -h will negate. Didn’t realize it conflicts with -R on the chmod command; thanks for mentioning it.

The risk of following symlinks with recursive ch* commands is unintentionally ch*ing files/folders any links refer to, possibly causing ownership/permissions problems. It can be abused for nefarious purposes.

Hi,

This is an excellent work, but I can do the same thing by just print it directly from Safari.

  • Go to Print Dialog page, select PDF.
  • Scroll down, find “Open With”
  • Select DevonThink.

Next time, select DevonThink for printing PDF, and virtually anything can be transferred to DT as PDF, not just from Safari.

Oh, you’re right, sorry :slight_smile: I forgot Finder wil ask you for the login/password. ForkLift which I use as the Finder replacement does not :slight_smile:

Thank you! That’s true, I mentioned this option in the text. The ‘Safari plugin’ way is simply a faster replacement of ‘Print > Save to DEVONthink’ workflow. You can invoke it with a single keystroke if you enjoy this kind of time savers.

I don’t see that under the PDF menu of Safari 4’s Print… dialog:

PDF menu.png

sjk>

Sorry for putting the info not detailed enough.
Go to “Edit Menu”, press “+”, select DevonThink.

That works for me.

D’oh! I’d looked there and didn’t think to click ‘+’.

Seems I’m dense, but I don’t see the advantage of using that method (or bartekb81’s SafariToDEVONthink Input Manager) instead of the Save PDF in DEVONthink Pro PDF Service (which can be assigned a keyboard shortcut, like others in the menu).

hi sjk,

can you provide some more info about this PDF service? how can I access it? do you mean the service under “PDF” button in the Print dialog? if so, how can I assign a keyboard shortcut to it? :slight_smile:

thanks,

Anything using InputManagers is DOA on Snow Leopard. 64-bit Safari shuns them, and forcing users to manually run Safari in 32 bit mode to use hacks like this is a craptastic workaround.

that’s true :slight_smile: sorry, but please blame Apple. My personal opinion here is: it’s a shame that’ Safari has no official ‘extensions’ support like Firefox does.

The issue being, like 70% of Safari’s crashes are due to Flash. Like 29% are due to Input Managers. Like 1% are due to Safari bugs. Therefore, sandboxing Flash, and eliminating the vulnerabilities of Input Managers, are a great way for Apple to reduce the number of OTHER peoples’ bugs they are blamed for :smiley:

I have to agree again :slight_smile: yes, and I love the Mac implementation of Flash plugin. It consumes about 30-40% CPU on each website containing Flash movies… at least on my Mac.

But OK, we’re going off topic :wink:

See the Droplets, Finder plugins, PDF Services page of the built-in Help.

Under the Keyboard Shortcuts tab of Keyboard & Mouse in System Preferences. Search around for more details if you need 'em. :slight_smile:

Funny. I found it but it actually doesn’t seem to work:

  • I see the defined keyboard shorcut in the PDF menu of the Print dialog…
  • …but the shortcut works only after clicking the PDF menu button and expanding the menu; without expanding it by using mouse the shortcut gets ignored; and there are no other DT commands using this shortcut, I’ve already checked that

It should work after opening the Print dialog, as described in:

macosxhints.com - Create keyboard shortcuts for the Print - PDF menu

Yes, that’s two steps but doesn’t require mouse usage.

Edit to add new article since original post:

macosxhints.com - Adding and using keyboard shortcuts in the Print dialog box

I’m trying to uninstall the plugin. I believe that I’ve followed the uninstall instructions properly, however I get the message: No such file or directory
[oswaldb-Computer-2:/Library/InputManagers]

I installed the plugin in my home directory.

I now wonder if I properly installed the plugin to begin with…the menu option never showed up under file in Safari. Is there another way to check if it ever got properly installed?