I’m trying to set the label of the parent groups of a collection of documents in a smart group. The script below, however, sends an error: “Can’t set «class DTla» of “/Documents/The parent group” to 1.”
set theRecord to (get record at "The Smart Group" in current database)
set theChildren to (children of theRecord)
repeat with oRec in theChildren
set label of oRec to 1
set parentGroup to the location of oRec
set label of parentGroup to 1
try
tell application "DEVONthink Pro"
set theRecord to (get record at "The Smart Group" in current database)
set theChildren to (children of theRecord)
repeat with oRec in theChildren
set label of oRec to 1
set parentGroup to the location of oRec
set label of parentGroup to 1
end repeat
end tell
end try
I do not get that error. Maybe you were not selecting a group when you ran the script?
However, perhaps the starting point is – what are you looking to accomplish with this script? You could, for example, without a script merely select all of the contents of a smart group and change their label.