Fast Bookmarking Method

This is the fastest method I have used to add bookmarks to DEVONthink from Safari. I made a simple script, with the help of another script that came with DT (written by Christian Grunenberg), that allows me to add the frontmost Safari page as a bookmark to the selected group in DT. I have this script assigned to a shortcut, and I’m using a small utility app called MondoMouse that allows me to select the DT window without clicking. All I have to do is move my mouse cursor over the DT window and it will automatically get selected. (I have the DT window positioned as a thin column-shaped window, like a sidebar, right next to my Safari window.) This saves me an extra click, so now I just have to select a group and use the shortcut. I have over 50,000 groups, so I first do a search & reveal to quickly find the right group. This is the fastest method I was able to come up with. I never use the inbox. It’s an unnecessary step. I will have to reorganize all the items in the inbox anyway afterwards. I might as well add my new bookmarks to the right groups right away. The bookmarklets would be useful if the Group Selector that appears afterwards had a search field. With that many groups it would take forever to find the right group by clicking through the group tree, collapsing and expanding. It’s just not practical because with that many groups it’s also difficult to remember the exact location of the group. Search & reveal is the only solution. As a side note, I really hope that you keep this use-case/workflow in mind when you design the iPhone app. There should be a search field after clicking on a bookmarklet in Safari Mobile that will allow me to search the database and reveal the selected search result inside a list view. Then I could, for example, save the bookmark in a location by clicking on a checkmark box next to the group name. I could then do another search and check more groups if I want to add the bookmark in more than one location. A “Done” button would exit the group selection mode and return me back to Safari Mobile. If the bookmarklet is just going to send the bookmark to the inbox, like the current desktop behavior, or just show a group list without a search field, like the current Group Selector, I will not be able to use it. Navigating a group hierarchy on the iPhone would be even slower. On the desktop I was able to improvise with this script, but on the iPhone this will not be possible.
I would really like to hear your opinion about my workflow. Can you think of a faster method for categorizing bookmarks?

The bookmarking script:

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 document 1
		
		tell application id "com.devon-technologies.thinkpro2"
			set theRecord to create record with {name:this_title, type:bookmark, URL:this_URL} in current group
			set unread of theRecord to true
		end tell
	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

This is a similar script that will create a RTF document with the selected text in Safari.

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_selection to do JavaScript "unescape(getSelection())" in document 1
		set this_title to the name of document 1
		
		tell application id "com.devon-technologies.thinkpro2"
			set theRecord to create record with {name:this_title, type:rtf, URL:this_URL, plain text:this_selection} in current group
			set unread of theRecord to true
		end tell
	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

Wow! That’s an amazing project. I don’t know of any other user who has even approached the number of groups you work with. I can see that procedures such as counting items in groups, that take no perceptible time for those of us with hundreds of groups in a database, could become significant in your database.

And why the database/groups panel provided by the ‘Select groups’ option would be unusable for choosing the location of new content in your database. :slight_smile:

Thanks Bill. I’m glad you agree about the shortcoming of the group selector when dealing with that many groups. Fortunately, the flexibility DTPro provides through its scripting environment allowed me to come up with a better solution. I’m excited about the iPhone app and hope it will allow for this kind of workflow too.

Hi,
Thanx for the great post. I have an elementary question about finding groups. Could you explain what you mean by “I have over 50,000 groups, so I first do a search & reveal to quickly find the right group”. I’d really appreciate some clarification.

Sorry for the late reply, thought I had email notifications on… (it’s on now)

You can select any item (group, document, etc.) in the search results list and use the ‘Reveal’ command (Data > Reveal or right-click > Reveal or keyboard shortcut) to jump to the location of that item in the group (category) hierarchy. It will select the item inside the list view. It’s a faster way to locate an item in your hierarchy, whether it’s a group or a document. Depending on the number of groups and the depth of your hierarchy, navigating your group hierarchy/stucture by expanding individual groups can take a long time and most of the time it’s a trial and error process because you can’t remember the exact location of the item you’re looking for.
When I come across a new web page that I want to bookmark/categorize, I search for a related term and look for an item in the search results list that best matches the topic/subject of the new web page. It doesn’t necessarily have to be a group. Most of the time I find a similar web page (bookmark) and ‘reveal’ it inside the list view to find out the group it is located in. Most probably this group will also be a suitable category for my new bookmark.

Hope this helps, let me know if you have any other questions.