How do I get a PDF from Safari into DTPro?

I’m finding this very frustrating. I want to be able to do one or both of the following:

  1. Right click a link to a PDF document in Safari, and use something in the Services menu to save the PDF to DTPro’s inbox
  2. Use the Services or Scripts menus to save a PDF document that is currently open in a Safari window to DTPro’s inbox.

Is there a good clean way of doing this without using the Print > Save PDF to DEVONthink Pro? I’d like to preserve the documents own metadata rather than let it get “printed” to PDF.

DTPro’s “add download” AppleScript event does not seem to work with links to PDFs, only HTML pages. Is this correct? I’ve had a fiddle with Automator-based Services but I figured I’d ask here to save myself frustration before I spend too much time on it.

If you install the Global Inbox in the Sidebar (DEVONthink Menu, Install Ad-Ons…), you can Command-S in Safari and select the Global Inbox as the destination.

That doesn’t work for me, possibly because I’m using TotalFinder. Will investigate. I’m surprised how much of a PITA this is.

  • I can’t tell the DTPro downloader to download a PDF either manually or using AppleScript (WTF)
  • Safari’s services support seems to suck and I can’t pass it a URL by right clicking a link (if I choose URL as the input type for the service the service just doesn’t appear, if I choose text it does appear but it just passes the linked text [ie. what’s inside the ] in rather than the URL)
  • I can’t tell DTPro to create record with {name:this_title, type:PDF document, URL:this_URL, source:this_source} (it just creates a blank item)

Hopefully the global inbox in the save dialog idea works, because this is ridiculous.

OK that works well, thanks! Just had to kill TotalFinder and DTPro was able to add the Inbox properly.

Actually it doesn’t work that well - there’s a race condition and DTPro often picks up the .download file before Safari is finished writing it :frowning: Back to the drawing board.

Sounds curious. My experience is that Safari dims the Save As command until the entire PDF is downloaded into Safari.

Sorry, I should have been more clear. In that instance it works, the problem occurs with right click > Save Linked File As.

Yes, that will fail as DEVONthink is importing the document into the database while it is still writing to disk. You could create a folder in the Finder and attach the Folder Action “DEVONthink-Import and Delete” script. Download the PDF documents to this folder using a right-click on the link, Download Linked File As… command. The script will wait until the download is complete before importing the document into DEVONthink.

Yeah that’s pretty much what I was thinking :slight_smile: Will give it a try.

Hi everybody,

I’m trying to come up with a solution to this problem ever since I use dt. Still this folderscript action is clumsy. I can’t believe that there aren’t more users looking for a simple and clean way to import the pdf opened in safari. It is so easy to clip web pages, why is it so complicated to “just” tell devonthink to download the pdf (url provided by safari) and ask the user where to put the file?!

Thank you very much for your help!!!

Gepsinger

It isn’t. As Greg mentioned above, a folder action can accomplish this. For example, I’ve used the folder action that I posted here. Because it uses the group selector, it always prompts me for the destination in the open database(s). As the rest of that thread explains, there are other possibilities.