How to refresh an archived web page

How do I force the record of a web page that I am currently viewing in DEVONthink Pro to refresh/resync with the underlying URL using Applescript? In effect I want to do the same as clicking on the Reload/Stop Loading button, but in Applescript.

I have tried something along the lines of:


tell application "DEVONthink Pro"
	set theRecord to content record of think window 1
	synchronize record theRecord
end tell

However, this doesn’t work.

Any help would be appreciated.

Stuart

You could use this code:


tell application "DEVONthink Pro"
	set theWindow to think window 1
	set theURL to the URL of theWindow
	-- Both lines necessary, otherwise the script has to be executed twice
	set the URL of theWindow to theURL
	set the URL of theWindow to theURL
end tell

Hi Christian,

that works like a charm. Many thanks.

Stuart

Very nice Christian. But I’m a little confused as to why the URL needs to be reset twice. Please educate us. Is this particular to DTP? Could I be so bold as to ask for a FAQ or “Secrets of writting Applescript for DTP” document. I would have never figured this one out. Thanks.

Gabe

Setting the URL of a window was never intended for reloading (only for loading a different URL). In the end it’s a caching issue. The only usage scenario comming to my mind is updating a captured web archive but that should be easier by using the new “download web archive from” command of V1.1.

I can’t find the command you reference above. However, control-clicking on a web archive in the document window (not its title) reveals a command called “Update Captured Archive.” I would interpret this to mean the archive I’ve save to my disk will be re-saved with new information from the original web site. If I were to duplicate the archive and update one and not the other, I’d have two different versions on my disk. Is this correct?

In this same pop-up menu, there are a few commands
For instance, what is the difference between:
Capture Page – seems to give me an html page
Capture Page Address – only the link, as if the URL had been dragged in from a browser?

Thanks.
Mark

That’s an AppleScript command.

That’s correct - “Updated captured archive” stores the currently visible page and therefore you have to reload the page if you want to save the latest page for example.

That’s also correct.