Correct way to get path to user template folder?

What is the preferred way to get the path to the templates folder? The way I’ve been doing it,

set templateDir to "/Users/" & (short user name of (system info)) ¬
	& "/Library/Application Support/DEVONthink 3/Templates.noindex/"

means that there are hardwired path elements that may change in future DEVONthink versions. Is there a property or function or some other approach in DEVONthink AppleScript that would return the path more directly?

No and yes. There’s no way you can get around inserting that partial path somewhere. But you can save yourself some typing, and the associated risk of typos:

set templateDir to POSIX path of ((path to application support from user domain as text) & "DEVONthink 3:Templates.noindex:")

1 Like

Thanks – that’s an improvement.