I have been using the below script to generate a “Project” folder structure, and it works perfectly. One thing I now end up doing after the folder structure is created is to add a Tag (or multiple Tags) to the newly created Project folder. It would be ideal if I could amend the script to add these tags via a second dialog box. Sadly my scripting capabilities fall well short of what I imagine them to be.… Any easy way to add this in?
-- Smart template adding a localized project template to the current group
-- Written by Eric Böhnisch-Volkmann, modified by Christian Grunenberg
-- © 2009–2016 DEVONtechnologies, LLC
-- Default non-localized project name, also used to identify the resources
property pTemplateName : "%groupName%"
property pAboutDocument : "About this project"
property pBlackColor : {0, 0, 0} -- RTF text color
-- Import helper library
tell application "Finder" to set pathToAdditions to ((path to application id "DNtp" as string) & "Contents:Resources:Template Script Additions.scpt") as alias
set helperLibrary to load script pathToAdditions
try
-- We're later working in DEVONthink, we need to cache localized strings while still in our realm
set theProjectName to localized string pTemplateName
tell application id "DNtp"
-- Let the user change the project name
set theProjectName to display name editor my helperLibrary's localizedString(pTemplateName) default answer "New Project" info (my helperLibrary's localizedString("Please enter a name for this project")) as string
set thePlaceholders to {|%project%|:theProjectName}
-- Import the predefined structure
set theTemplateFiles to helperLibrary's pathToLocalizedResources() & my helperLibrary's localizedString(pTemplateName)
set theRecord to import theTemplateFiles placeholders thePlaceholders to current group
set (name of theRecord) to (name of theRecord & ": " & theProjectName as string) -- Rename to user-defined project name
end tell
on error errMsg number errNum
if errNum ≠ -128 then display alert (localized string "An error occured when creating the new project structure") message errMsg as warning
end try