Questions on "Locked" items/groups

I have two questions:
(1) How to lock a group with subgroups in one-go. Can I use this script as trigger-script (Understanding lock function & lock inheritance) to have all items inherit the locked status of a top-level locked group? Or can I construct a general smart rule to lock a selection of groups/items that I drag and drop on to it? I hope someone can show me how to do it via smart rule.

(2) The DT3 treats locked items the same way as DT2. Locked group/item can be moved to trash although the app will ask for trash option when the empty-trash is activated. IMHO, not allowing locked item to move-to-trash seems more natural to me or perhaps some other users. I wish DT would consider adding a hidden preference in future version update to prohibit moving locked items to trash?

PS: I am aware that it is not trivial to add this suggested hidden preference due to the logic of workflow. For example, if only some of the items or subgroups are locked under an “un-locked” group then the move-to-trash of the main group will be leaving a bunch of locked items at the root of the database. I will try to think of a suggestion later…

1 Like

I agree with that. I was previously a little confused when I discovered I was able to move a locked item to trash.


An updated script for smart rules looks like this:

on performSmartRule(theRecords)
	tell application id "DNtp" to my lockItems(theRecords)
end performSmartRule

on lockItems(theseRecords)
	local this_record
	tell application id "DNtp"
		repeat with this_record in theseRecords
			set locking of this_record to true
			if type of this_record is group then my lockItems(children of this_record)
		end repeat
	end tell
end lockItems