Smart Folders in DTTG: an approximate solution

Smart Folders are an extremely useful tool in DT on the Mac, but are currently not available on DTTG. For certain scenarios I find it very useful to have the contents of a DT smart folder available on DTTG. Here is what I do when I have such a smart folder (say smart1) on DT:

  • create a regular folder (group) of the same (or similar) name, say smart1_ in the same DB
  • drag the smart folder to the sidebar onto the smart rule area
  • a smart rule with the same name will appear, and it will contain the search criteria of the smart folder.
  • edit this rule by adding the action Replicate to smart1_ and execute the rule before synchronization.
  • smart1_ will then be accessible on DTTG.

Obviously, this only works with all smart action happening on DT, but that covers the bulk of my needs. Since the smart folder can be dragged onto the smart rule area, this is really quick to set up. If your Mac/DT run all day long, changes made on DTTG will sync back, the smart folder updates, the smart rule kicks in, and the updated “clever folder” as I call it syncs back to DTTG. Near realtime!

N.B.: If the smart folder conditions are edited, the smart rule will not follow, it’s an independent item now. So this works best for relatively stable smart folders.

5 Likes

Thank you for sharing this tip!

This can actually be automated via a smart rule script:

-- Mirror Smart Groups
-- NOTES: 
--	- The smart rule should search only for all or certain smart groups (in one or all databases) and use the trigger "Before synchronization"
-- 	- We add only additional replicants to the mirror, it's up to the user to move all instances of undesired items to the trash
on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with theSmartGroup in theRecords
			if (type of theSmartGroup as string) is "smart group" then
				set theLocation to location of theSmartGroup & name of theSmartGroup
				set theGroup to create location theLocation in (database of theSmartGroup)
				-- This doesn't add multiple replicants to the same group, therefore no need to check the existence of a replicant first
				-- In addition, this is the most efficient solution and avoids unnecessary changes (and up/downloads)
				replicate record (children of theSmartGroup) to theGroup
			end if
		end repeat
	end tell
end performSmartRule