importing html directly into DT

is there any plan in future enhancements to add an item to the menu or services to import a web page directly into DT as is done directly from DA? I’d love to be able to click on omniweb/services/dt/import page and be done with it.

OmniWeb decides what information they will make available through the Services menu. you should direct this suggestion to them.

if OmniWeb provides the information (URL, HTML) to the Services menu, I think DEVON will be happy to add the capture funtion.

DEVON doesn’t hack anyones code.

i guess maybe i’m confused then. in either OW or Safari there is a DT menu item under Services with a bunch of options that are all grayed out unless text is selected. Wouldn’t this be a matter of DT simply copying the URL from the active window and moving it to DT? Why would this require Safari or OW to do anything?

you are trying to make this a question of what DEVONthink does; it is primarily a question of what the browser does.

the developer of the browser has to provide an interface that DEVONthink can use to get the necessary information. this is true for Services and it is true for AppleScripts.

the developer of DEVONagent provided the interface; the developers of other browsers did not. as a result, DEVONthink can get the information from DEVONagent; DEVONthink can not get the information from other browsers.

I hear what you’re saying, but I’m still missing something.

I can highlight text in Safari or OW and use services to import it as a rich text document. Are you telling me those application’s developers specifically programmed the ability to communicate this to DT through services?

I’ll bet money that’s not the case.

So if I can do it with plain text, why can’t I do it with HTML. There is no freaking way Safari’s developers said “hmmm, let’s provide rich text to this app called DEVONthink, but we’re drawing the line there, no html.”

mathes23:

subscriber3 is correct in stating that the developers of Safari and OmniWeb have not directly included hooks in Services to allow DEVONthink to capture an HTML page together with its URL.

But the beta of DEVONthink Pro includes several scripts (in the Scripts (Additional) folder) to collect information from the frontmost Safari page, including one that does capture the HTML source and URL of the page.

This approach isn’t exactly what you want, since one has to first open the page in Safari, then go to DEVONthink Pro to invoke the script. But it achieves the bottom line that you’re asking for. I haven’t tinkered with the script, but – because OmniWeb uses the Safari core – I suspect that the script could be modified to work in the same way with OmniWeb.

Will such a feature come to DEVONthink PE? I don’t know. DEVONthink Pro is much more scriptable than PE.

Safari’s developers said “hmmm, let’s provide rich text to any app requesting it through Services, but we’re drawing the line there, no html.”

I think I would not place too much hope on the ability to script OmniWeb to capture pages to DEVONthink until someone actually tries it.

Bill…I plan on migrating to Pro when it is released. I wonder if we could use a quick keys script to invoke the DT script from within OW and not have to leave the app.

subscriber3…interesting. So the browser developers provided generic capability to export or provide a hook for text, but not for the url of the active window?

dang, that seems like one of the most basic things a browser should provide through the services menu.

ok, so if I’m in OW I just triple clicked on the url to highlight the whole thing and in Services is an option to open the url or open it in OW. That tells me that OW is configured to take that highlighted piece of information and send it somewhere.

in DT, I can take that url and import it as plain or rich text. So why couldn’t DT simply add an option that said “import html page” using the highlighted selection?

you have now switched to the URL (which points to the HTML) rather than the HTML itself.

the way DT works, I think this would be “Capture Link”.

as far as doing this, I really don’t know.
hopefully someone who does will pick this up.
it does sound like DT would have to parse the item to see if it “looks like” a URL and not some random bit of text, but that seems straightforward.

I assume you are aware that most browsers have a
File > Save Page As
which will save the HTML to the desktop
and allow the URL to be dragged to the desktop.

the resulting files can then be imported or dragged into DT.

but I think you want a more streamlined solution.

close, but not really. what i’m trying to find is a hook that DT can use to grab the html. That IS the object of the import, but I would think that if the browser could supply the url to DT that DT could then load it using its own browser functionality and then capture the page.

i just want it done in one step behind the scenes.

I’ll play with QuickKeys and see if I can automate the process of copying the URL to DT, bringing up DT, capturing the page, then returning to the browser window from where this all started.

just seems like something DT should be able to do for me.

DEVONthink Pro gets the HTML from a webpage opened in Safari through the ‘source’ property of a document. This ‘source’ property is specified in the AppleScript dictionary of Safari but not in OmniWeb…

Bill, you do not have to switch from Safari to DEVONthink Pro to run the script. You can run this script from the Script Menu if installed or from any other application that can invoke applescripts, like DragThing or FastScripts.

Rudi:

Thanks for catching that. I had installed the Safari scripts in my Users/username/Library/Application Support/DEVONthink Pro folder – but of course I could have installed them in my bootvolume/Library/Scripts folder to make them accessible from any program. :slight_smile:

By the way, Merry Christmas to all.

or, install the Safari scripts in
bootvolume/Library/Scripts/Applications/Safari
or ~/Library/Scripts/Applications/Safari

so they are only on the menu when Safari is the front application

(this will work with the scripts written for any application if you want a short menu of relevant scripts instead of a long menu to pick through, just substitute the application name for Safari in the path)

I put a possible workaround for OmniWeb and DEVONthink Pro into the Beta Testers DEVONthink section. The subject is: “Add HTML page from OmniWeb to DT Pro”.

once DT pro is released could you post it here so those of us who aren’t beta testers can see it?

Yes, I will post it here once a public version of DEVONthink Pro is released and if Christian Grunenberg does not provide a better way to do it.

thanks man, much appreciated.

and thanks to all who contributed on this thread.

I’m going through a trial version with QuickKeys, i’m gonna play around and see if there’s a way I can automate that. Would love to just be able to hit shift/command/n or something and have it automatically done.

ok, just got a quickkeys script to work. for some reason I couldn’t get quickkeys to be able to use context menus so before the script is invoked I have to triple click the url address to highlight it. then what the script does is copy the url into dt, capture the page, delete the copied url so that only the captured page is left, minimize dt and return to the browser.

nothing fancy, but it works. would be happy to share it with anyone who might be interested.

gotta go over to the qk forum and see what i’m doing wrong with trying to access context menus. This thing is pricey at $100 but it sure is handy to have around.