As my databases have grown and as I get more and more nested subsubsubsubsub groups I struggle on the productivity front.
What is the way to have a parent group
that is excluded from classification to drive exclusion also to its sub and sub sub sub group. ?
that has the correct layout that is columns (name, modification dates etc…) which are carefully picked + sorted at the folder level (or even at the root database level) to drive these settings also to its sub and sub sub sub group. ?
On these 2 I lose too much time now setting these down the subsubsubsubsub and manually there might be a less dumb way for the dummies…
This is not possible without scripting, either a standalone script or in a smart rule / batch process.
Here is a teaching edition snippet that does what you’re referring to…
tell application id "DNtp"
-- Get the selection
set sel to selection
-- If there is something selected, proceed.
if sel ≠ {} then
set sel to item 1 of sel
-- Is it a group?
if (type of sel) = group then
-- Get the current exclusion of the selected group
set parentExclusion to (exclude from classification of sel)
-- Call a handler to process any subgroups
my processGroups(sel, parentExclusion)
end if
-- If nothing is selected, disaply an alert and exit.
else
display alert "Nothing is selected. Please select a group and run this script again."
end if
end tell
on processGroups(theGroup, parentExclusion)
tell application id "DNtp"
-- Loop through the children of the selected group, specifically targeting the children in the selected group who are subgroups
repeat with theChild in (children of theGroup whose (type = group))
-- Set the same exclusion state to the parent's exclusion state
set (exclude from classification of theChild) to parentExclusion
-- If this subgroup contains children who are groups, process them by recursively looping back to this same handler
if (count (children of theChild whose (type = group))) > 0 then
my processGroups(theChild, parentExclusion)
end if
end repeat
end tell
end processGroups
If you set columns in a database, those should propagate to its groups (though @cgrunenberg would have to comment on the difference in the horizontal positions of the columns being different when you open a group in a new window).
Thank you very much for your time
I regret I have no experience in scripting not even the slightest idea where to put that snippet…
Would you have for your devonthink solution a network of experts who can help for a fee to implement this ?
Thank you very much
Drop the .scpt file into the Menu folder (or a subfolder in this folder). It is now available in the Script menu. You can select a group and run the script and it will apply the current exclusion to its subgroups.
Thank you so much !
I ran the script on a large database with many sub sub etc…groups and it would have been humanly impossible to run this manually…So provided you wait some time for the script to go folder by folder to run its magic it does work like a breeze…
Except I noticed only folders inherit the exclusion status, not any files will inherit that exclusion status from this script
But is it safe to assume that the way exclusion from classification work in DT (which is something I did not know) is like “files in a folder that is excluded from classification and of which they directly depend will always be excluded from classification” ?
I am sorry but just want to make sure…
Thank you !
Of course that is logical.
I guess what got me puzzled is the presence at file level of that exclusion tick box (which doesn’make any sense ) so just wanted to make sure…
Thank you very much again your help much appreciated here this has made my day Thank you
That is actually very very useful to have in mind and how this works in reality…
Thank you…
I have used several strategies for grouping which included the assumption that I better slice my groups in a way where no outlier-files would pollute the inside-cohesiveness of the group.
So for the outlier-files I would endup having to create groups (excluded from classification) that are buckets containing only outliers…which was I guess making sense for the purpose of avoiding classification to dis-function but terrible on many other aspects including the strange existence of these groups dedicated to be filled with totally unrelated files, real black holes filled with all sorts of missfits…
I see now that I do not need to bother doing that, just exclude from classification the files which are outliers-but-still-would-need-to-be-in-that-specific-group.
I guess I can get rid of many horrible very ugly black hole groups now…
Thank you very much for your support
Thank you very much for sharing this script! Just to make it clear to any other lay users who are not familiar with AppleScript (such as myself), you have to manually mark the group whose subgroups you want to exclude as excluded from classification. I thought the script would do it for you. It would be useful if the script had an error message to the effect that “selected group must be set to excluded from classification for script to work.” I assumed it just didn’t work, but after manually going through about 200 groups this morning and excluding them, I decided to give it another try. It worked!
The script is meant to act as a toggle, hence the need to set the exclusion on the parent folder. This allows you to toggle it off as easily as toggle it on.