# Setting up favorite groups

**URL:** <https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767>\
**Category:** Tips\
**Created:** [February 6, 2009, 1:32pm UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767 "2009-02-06T13:32:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenUK](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/stephenuk/32/30539_2.png) [@StephenUK](https://discourse.devontechnologies.com/u/StephenUK)\
**Post date:** [February 6, 2009, 1:32pm UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/1 "2009-02-06T13:32:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JRPars](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@JRPars](https://discourse.devontechnologies.com/u/JRPars)\
**Post date:** [February 15, 2009, 4:39pm UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/2 "2009-02-15T16:39:24Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![sjk](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/sjk/32/32_2.png) [@sjk](https://discourse.devontechnologies.com/u/sjk)\
**Post date:** [February 17, 2009, 6:08pm UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/3 "2009-02-17T18:08:55Z")

</div>

FYI: Most of the end of that script is truncated compared to the one in your [earlier post](http://www.devon-technologies.com/scripts/userforum/viewtopic.php?p=27007#p27007) (and [Eric’s original](http://www.devon-technologies.com/scripts/userforum/viewtopic.php?p=14664#p14664)). And the originals generate this error when compiled (with DTP 2.0pb3 installed):

![reveal replicants - compile error.png](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/1X/732789d81ab1a58c71421fc39a300c06957af7ce.png)  
Tip: Putting scripts between BBCode “code” blocks (like Eric did) makes them more readable and can help reduce copy/paste errors.

---

<div class="post-metadata">

**Author:** ![JRPars](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@JRPars](https://discourse.devontechnologies.com/u/JRPars)\
**Post date:** [February 26, 2009, 8:44am UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/4 "2009-02-26T08:44:54Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![sjk](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/sjk/32/32_2.png) [@sjk](https://discourse.devontechnologies.com/u/sjk)\
**Post date:** [March 10, 2009, 8:03pm UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/5 "2009-03-10T20:03:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![acl](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/acl/32/4301_2.png) [@acl](https://discourse.devontechnologies.com/u/acl)\
**Post date:** [March 11, 2009, 4:00am UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/6 "2009-03-11T04:00:21Z")

</div>

> [@sjk](#):
>
> FYI: Most of the end of that script is truncated compared to the one in your [earlier post](http://www.devon-technologies.com/scripts/userforum/viewtopic.php?p=27007#p27007) (and [Eric’s original](http://www.devon-technologies.com/scripts/userforum/viewtopic.php?p=14664#p14664)). And the originals generate this error when compiled (with DTP 2.0pb3 installed)

There was a word missing. This should work:

```auto

---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

```

---

<div class="post-metadata">

**Author:** ![system](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/4/4e6ff70c96be2eb307a274d890bba8d71ba671b3.png) [@system](https://discourse.devontechnologies.com/u/system)\
**Post date:** [January 21, 2022, 11:03am UTC](https://discourse.devontechnologies.com/t/setting-up-favorite-groups/6767/7 "2022-01-21T11:03:38Z")

</div>


