Script to select all records in a database

I want select all records (excluding tags, groups, etc.) in a DTPO database, and I can’t seem identify how to do this. Any solutions (e.g. code) would be greatly appreciated.

John

Make a smart group that looks like this, then select everything in the smart group:

Thanks, but can you use Applescript to accomplish the same thing? Although the smart groups approach is I must confess quite simple.

What are you trying to accomplish with having a script select all the records in a database? Maybe knowing that will help understand the objective.

If by ‘select’ you simply mean get an Applescript reference to all content records, you could, of course, write something like this:

tell application id "DNtp"
	tell front database
		-- GET A REFERENCE TO ALL CONTENT RECORDS
		set refAll to a reference to contents
		
		-- GET A LIST OF THE VALUES OF SOME PROPERTY OF THESE RECORDS
		set lstNames to name of refAll
		
		-- SORTED VERSION OF NAMES OF ALL RECORDS 
		set {dlm, my text item delimiters} to {my text item delimiters, linefeed}
		set lstNames to paragraphs of (do shell script "echo " & quoted form of (lstNames as string) & " | sort")
		set my text item delimiters to dlm
	end tell
	
	lstNames
end tell

( Otherwise, I may be missing something, but my impression is that the selection property of a window is read-only )

Thanks! What I was looking for. John