Thanks for the fast reply. It does not work. I get this error:
Can’t make «class DTpr» id 1232208 of «class DTkb» id 2 of application “DEVONthink 3” into type vector.
My (test) code looks like this:
tell application id "DNtp"
tell database "MYDB"
set theRecord to (first child of record "Mags")
--return theRecord
set theTag to get record at "/Tags/Software/Test"
--return theTag
set tags of theRecord to tags of theRecord & theTag
end tell
end tell
Note this kind of redundancy of tags - and our recommendation to not do this - is discussed in the documentation - Help > Documentation > Getting Started > Tagging > Nested Tags.
tell application id "DNtp"
repeat with theRecord in (selection as list)
-- Works even if the nested tag doesn't exist yet
set theTag to create location "/Tags/ParentTag/SubTag" in (database of theRecord)
replicate record theRecord to theTag
end repeat
end tell
tell application id "DNtp"
set sel to (item 1 of (selection as list))
set tags of sel to tags of sel & {child "02" of child "123" of tags group of current database}
end tell
(And yes, Tags must be presented as a list, per the dictionary.)