Group name to all its contents

Hello to the powerful community of the powerful software!

Let’s say I have many groups with texts in them. How can I import the name of the group (or the clipboard) at the bottom of all the text documents the group contains?

I am trying to organize my references so I can import the title of source (group name) to the texts (the notes I have written).

Just have a look at this thread:

Thanx for the reply but it seems that there is a problem. Whenever I run the script from the Script Editor, I get an error. How should I alter the script you provided above?

It helps if you quote the error exactly as it is printed on your screen/console.

As a warning: You may laugh with my Scripting skills at the moment. I promiss I will learn some scriptin’

This is the error i get:
DEVONthink Pro got an error: Can’t make name of parent group of content id 320072 of database 1 into type reference.

When i run this scrip:

tell application "DEVONthink Pro"
	set theWindow to think window 1
	copy the selection of theWindow to theSelection
	repeat with theRecord in theSelection
		set thegroupname to (name of parent group of theRecord)
		set the selection of theWindow to {theRecord}
		delay 1
		tell text of theWindow
			make new paragraph with data (thegroupname & return & return) at beginning
		end tell
		tell theWindow to save without asking
	end repeat
end tell

and it’s highlighting the word “name” in the fifth line. Any comments?

Just replace “name of parent group” with “name of parent 1”. Warning: Records can have no, one or multiple parents.


Thank you very much!! I think adding the group’s name to the text files might be very useful to some people. Thanks once again.