How to exclude newly created location from tagging?


I wonder if there is a way of specifying whether a location created in a script is excluded from tagging or not?



You can exclude groups from tagging by setting the “exclude from tagging” property. But “create location” returns only the last group of the hierarchy, therefore excluding all enclosing groups if desired might need a little more work.

Thanks. Can I only set the ‘exclude from tagging’ property when using ‘create record {type:group}’. Because I want to check if the group already exists when creating it I need to use ‘create location’. Is there a way of setting the ‘exclude from tagging’ property using ‘create location’ and if so, how would I write this in a script?

You can set this or any property of any record, no matter if created via “create record with {}” or “create location”. Just use the result of the command and set its property, for example…

tell application "DEVONthink Pro"
	set theGroup to create location "/whatever"
	set exclude from tagging of theGroup to true
end tell