Hello, maybe this is just not going to work, but I thought I’d put it out there…
For a variety of reasons, I have my files indexed, not imported, into DTPro. One feature that I just love is the bookmarklet that imports just the bookmark (.webloc) file into DTP. What I really want to do is to be able to use this bookmarklet, or one like it, to grab the .webloc file and index it, not import it.
Possible? If not, is there any other way to get a .webloc from Safari aside from dragging from the address bar?
Many thanks,
Robin
The only possibility is probably AppleScript. Here’s a rough example adding a bookmark to the desktop and indexing it afterwards. Just save it in the folder ~/Library/Scripts/Applications/Safari and it will be available via the Scripts menu extra afterwards.
WARNING: This script contains almost no error handling (e.g. if the bookmark exists already or couldn’t be created).
tell application "Safari"
try
if not (exists document 1) then error "No document is open."
set this_URL to the URL of document 1
set this_title to the name of window 1
tell application "Finder"
set theDestination to path to desktop folder
set theBookmark to make new internet location file to this_URL at theDestination with properties {name:this_title & ".webloc"}
end tell
tell application "DEVONthink Pro" to indicate theBookmark as string
on error error_message number error_number
if error_number is not -128 then display alert "Safari" message error_message as warning
end try
end tell
Of course! thanks so much, very appreciated.