I am writing a handler as a part of my script to create a new file from a few frequently used templates (no template scripts within). I am not familiar with scripting Finder, but this handler does what it is expected for a one-level folder.
EDITED. This method of extraction can not handle a nested top folder nor to distinguish file vs folder. I wonder how to code for the extraction of the templates for a nested top folder?
Thanks
set thePath to "/Users/username/Library/Application Support/DEVONthink 3/Templates.noindex/Favorites"
tell application "System Events"
set ll to {name, POSIX path} of every disk item of folder thePath
end tell
tell application id "DNtp"
-- I am simplifying the preparation of the list here
set theTemplate to choose from list ll's item 2
set newDoc to import template (theTemplate as string) to incoming group of current database
end tell