Setting up favorite groups

Hello

I am new to Devonthink Pro. Lovely program. One thing I miss from other programs under Windows is the ability to move quickly to a group several layers down, eg in order to file something there. The solution I have come up with is to replicate the groups I go to frequently, and to place the replicated groups in a first level group entitled “favorites”. That way I only have to go one level deep.

I have two questions. Firstly, is this the best approach, or is there another easy solution I am missing? Secondly, using this approach (which works quite well for me) has just one problem. If I am in one of the replicated groups under my “favorites” group, I often need to go to the original group buried deep in the tree. I would expect a command such as “locate replicate” or something similar, but there doesn’t seem to be anything. Am I missing something?

Stephen

I don’t know if this will do what you are looking for, but here is a script that I’ve found useful in terms of finding replicants. Double clicking on the find takes you directly to the file.

–reveal replicants script 1.1 by Eric Oberle
set replicant_on_root to false
tell application “DEVONthink Pro”
set the_item to selection
if the_item is {} then
error “Please select a replicant.”
end if
set the_item to first item of the_item
set num_reps to (number of replicants of the_item)
if num_reps is 0 then
error “Please select a replicant.”
end if

set the_name to name of the_item
set num_reps to (number of replicants of the_item)
set the_parents to parents of the_item

FYI: Most of the end of that script is truncated compared to the one in your earlier post (and Eric’s original). And the originals generate this error when compiled (with DTP 2.0pb3 installed):

reveal replicants - compile error.png
Tip: Putting scripts between BBCode “code” blocks (like Eric did) makes them more readable and can help reduce copy/paste errors.

@sjk - you’re quite right about the code blocks. Thanks for that reminder.

On the other matter, the original, untruncated script works fine in my databases. I’m on 2.0 pb3r2

Thanks for letting me know the original script works for you. Maybe I’ll give it another try with 2.0pb4.

There was a word missing. This should work:


---reveal replicants script 1.1 by Eric Oberle 
set replicant_on_root to false
tell application "DEVONthink Pro"
	set the_item to selection
	if the_item is {} then
		error "Please select a replicant."
	end if
	set the_item to first item of the_item
	set num_reps to (number of replicants of the_item)
	if num_reps is 0 then
		error "Please select a replicant."
	end if
	
	
	set the_name to name of the_item
	set num_reps to (number of replicants of the_item)
	set the_parents to parents of the_item
	
	
	try
		if current group is "current application" then
			set current_group to {root of current database}
		else
			set current_group to current group
		end if
	on error
		set current_group to {root of current database}
	end try
	log current_group
	
	
	set location_of_selection to location of the_item
	if location_of_selection is "/" then
		log "selected item has replicant  on root"
		set replicant_on_root to true
	end if
	
	set unique_parents to {}
	set location_of_parents to {}
	
	----weed out replicants in same group as seleted one
	repeat with i from 1 to count the_parents
		log {the_parents's item i}
		log "location of parent=" & location of the_parents's item i
		if the_parents's item i is not current_group then
			log "**found unique replicant " & location of the_parents's item i
			set unique_parents's end to item i of the_parents
			set location_of_parents's end to (location of item i of the_parents) & name of item i of the_parents
			
		end if
	end repeat
	log "location" & location_of_parents as string
	if replicant_on_root then set location_of_parents's end to "root"
	
	if location_of_parents is {} then return
	repeat until false
		set x to choose from list the location_of_parents with prompt "These folders contain replicants of " & the_name & ".  Double click (or hit ok) to open a given  parent in a new window, click cancel button to exit."
		if result is false then
			return
		else
			set location_chosen to item 1 of result
			if location_chosen is not "root" then
				set the_index to my list_position(location_chosen, location_of_parents)
				set the_location to item the_index of location_of_parents
				set the_record to (item the_index of unique_parents)
				set the_Window to open window for record the_record
				set full_location_of_the_replicant to the_location & "/" & the_name
				set the_replicant to get record at full_location_of_the_replicant
				set selection of the_Window to {the_replicant}
			else
				set the_id to get id of the_item
				set x to get record with id (the_id) in root of current database
				set x to {x}
				set the_Window to open window for record root of current database
				set selection of the_Window to x
				
			end if
		end if
	end repeat
end tell


on list_position(this_item, this_list)
	repeat with i from 1 to the count of this_list
		if item i of this_list is this_item then return i
	end repeat
	return 0
end list_position