Thanks so much for that…but I still get the following error:
error "Can’t get item 1 of {}." number -1728 from item 1 of {}
I must be doing something stupid. Let me look at it yet again. The only material difference now between my code and yours is my line:
set theDatabase to open database "/Users/stapp/Documents/DevonThink/Diaries.dtBase2"
with the consequent change in the following line.
Stephen