View all items in subgroups

Hi, I’m a new DTPO user and I’m really enjoying the organizing capabilities of this wonderful software. There’s one thing that bugs me though, and maybe the capability is there but I just haven’t found it yet (though I’ve search the menus, help files, tutorials, and forum to no avail).

What I would like is to be able to select a group (folder) and see all the items in all subgroups (subfolders) beneath it, not just the folders of the next lower level. You know, like recursively. Does this capability exists and I just can’t find it? It would great if so. If not, this certainly would rank high on my feature wish list. Thanks!

Open your group in its own view window. Switch to the Vertical Split view. Or the List view.

Choose View > Expand All.

Thanks, Bill. Not exactly the functionality that I’d envisioned, but it works.

not sure whether I understand correctly but if you hold the option key while expanding a group (by clicking on the triangle) all groups inside will expand recursively (works like in Finder list view).


Yep, that works too, and it’s a handy shortcut. Thanks for mentioning.

What I was really looking for, though, is the option to click on a group in the left-hand pane and see all the documents in all descendant subgroups in the right hand pane (in the same manner that you would see them if selecting a leaf group). It’s a bit difficult to get perspective on your documents when they’re all in the left-hand pane.

I think this would add an extra organizational “feature” to the program – the ability to increase/decrease granularity while perusing documents. For example, if I have a project group with subgroups corresponding to years and further broken down into months, if I want to see all documents for a given year I’d just select that subgroup from the left-hand pane. If I then decide I’d like to narrow the focus, I’d select an appropriate subgroup from the left-hand pane and the right-hand pane would update correspondingly.

OK, I see what you are saying.

You want to be able to select a group and see a flat list of all of the documents contained in that group, regardless of their hierarchical placement within that group.

Then you want to be able to select any subgroup and see a similar flat list of all the documents within that subgroup.

I haven’t needed to do that sort of manipulation in a long time. But back in the days of my bureaucratic life in government, such data manipulations were the heart and soul of reports, budgets and plans.

Example: during a budget year a number of water quality samplings were done in various watersheds, each resulting in a report. Suppose we organize those sampling reports by watershed, with subgroups by month.

Now, using your approach, we could produce all sorts of lists in support of those bureaucratic reports. (We could do this using the current views, but, with more steps using replication to other locations.)

Your suggestion is noted. But no promises as to if or when.

Anyone else think such a view would be useful?

Yes! Thanks, Bill. That’s it precisely!

That does sound useful to me, but I wouldn’t know how useful until it was actually implemented!

This would be nice, I think. If nothing else, it’d be good to have the versatility. I’ve actually wanted a similar feature, but not enough to post about it. It’s come up a couple times.

What if the Search Window (Shift+Cmd+F) defaulted to showing all documents in the selected group?

For instance, you select any group in DTP, press the hotkey, and a new Search window opens up with the contents of that group and all of its subgroups. This sort of works now, after a few steps (selecting group and leave the search field blank, searching in all documents with state=off).

It’s not quite the same, since it doesn’t have the hierarchical view to the left panel, but it would seem to be an easy alteration to make to the source code. Provide an option to disable it for large databases, possibly?

If nothing else, it might be a nice workaround to last us a while if a true “recursive listing” were present in 2.0.

I had the same need/feeling as you. Therefore i have developed a script (far away to be perfect but it works for me).

The script is generating a new Folder in a definable postion (using the variable flatViewFolderRootName) with starting with an definable name by using the variable flatViewFolderName]. It searches for all documents in the selected folder a fills the “Flat Folder” with their replicants. Finally it opens a new full screen window in Thumbnail view (NOTE: Here you must check at the end of the code it the keyboard shortcuts are corresponding to yours).

I hope this helps a bit.

-- This is a simple script to create a Flat View of an Folder hirchie
-- The scripts extracts recusrsivly from the current selected Folder all documents (excluding Folders) and replicates tehm into an Flat View Folder.
-- 03/03/2012

-- The Flat View Folder will be generated in the following defined root.
set flatViewFolderRootName to "Datenbank Verwaltung"

-- Name of the Flat View Folder (The Folder will be extended with the selected Folder)
set flatViewFolderName to "Flat View"

tell application "DEVONthink Pro"
		-- Get current Selection and check if an record is selected
		set theSelection to the selection
		if theSelection is not {} then
			-- Search in the current database for "Flat Folder"
			set searchResult to (search flatViewFolderName within titles)
			-- Delete existing "Flat Views" 
			if searchResult is not {} then
				set currentFlatViewLocation to (get beginning of searchResult)
				delete record currentFlatViewLocation
			end if
			-- Search in the current database the special folder "Datenbank Verwaltung"
			set searchResult to (search flatViewFolderRootName within titles)
			-- Add a new "Flat View" 
			if searchResult is not {} then
				-- Create the Folder
				set currentFlatViewLocation to (get beginning of searchResult)
				set selectedFolder to (get beginning of theSelection)
				if type of selectedFolder is not group then error "Only folders are allowed. Please select a folder (smart folder and documents are not valid)."
				set flatViewFolderName to (flatViewFolderName & " :: " & (get name of selectedFolder))
				set newRecord to create record with {name:flatViewFolderName, type:group} in (currentFlatViewLocation)
				-- Fill with replicants of the selected folder by searching for files in the selected folder
				set searchResult to (search "*[a-z] *[0-9]" in selectedFolder)
				-- create replicates
				repeat with theRecord in searchResult
					replicate record theRecord to newRecord
				end repeat
				-- Open a seperate Window to show emmideately the result of "Flat View"
				open window for record newRecord
				-- Change to Thumbnail View and Zoom the Window to Fullscreeen
				-- You have to adopt the keyboard commands to your needs
				tell application "System Events"
					-- Changing to thumbnail view
					keystroke "1" using {command down}
					-- Full Screen Zoom
					keystroke "z" using {command down, option down}
				end tell
			end if
			error "Only folders are allowed. Please select a folder (smart folder and documents are not valid)."
		end if
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro - Flat View Script" message error_message as warning
	end try
end tell

Thanks a lot, Martin. I don’t fully understand how this works. What would be a typical English expression to put in place of “Datenbank Verwaltung”?

This is just a general folder I have in all my databases. “Datenbank Verwaltung” means “Database Administration” where I collect all for tof special Folders to maintain my database informations.

For the script you can use any folder name you like - It’s up to you.
Hope this helps.

Best Regards

Thanks for the quick reply, Martin. This is really very useful, in the absence of the kind of feature envisaged by patch1103, which reminds me of the views in Yep and Leap.

In the last days I found out the script is sometimes not showing all files and additional it showed folder which should not be presented. Therefore I updated the script as follows:

-- Fill with replicants of the selected folder by searching for files in the selected folder
set searchResult to (search "*[a-z]* or *[0-9]* or *[A-Z]*" in selectedFolder)
-- create replicates
repeat with theRecord in searchResult
   if (type of theRecord is not group) and (type of theRecord is not smart group) then
	replicate record theRecord to newRecord
  end if
end repeat

I just started using Devonthink Pro Office 2.7.1. It’s a great application. But I’m also missing the requested feature very much: To get a list of all files in all subgroups when selecting a group.

Is there any chance to get this implemented? Or didn’t I just find the way to do so?

Unfortunately the fix provided by Martin M. seems not to work any more in this version.

I found this thread alive for 5 years. So I try to keep it running.

All the best,

  1. Why? Just curious.

  2. Have you tried Column view? Or double-clicking a group to open it in its own window and selecting View > Exapnd All ?

  3. How often do you need this functionality? It’s also possible to create a Smart Group, say called “All Files” with criteria: Kind is Any Document and the “Search In” drop down pointing at a particular Group.

I came to this forum with this exact same query. Created ones just like Bluefrog suggested and placed them in the relevant parts of the folder hierarchy. Works a treat and very simple to do. Also means that I can still spot those files that are only relevant to a master folder (e.g. pan-Europe in the ‘Europe’ folder) rather than being in a sub-folder (e.g. UK, Germany, etc.).

Glad to help.
(PS: Sorry for the late moderation! :blush: )