Table of Contents Updating

This is probably not possible but as my Father used to say, “If you don’t ask, you don’t get!” So here goes. I find the menu command “Create Table of Contents” most useful and I periodically work through the Groups in a database to update the TOC as inevitably some stuff is added, moved or deleted over time. In addition I have a Smart Group which gathers all the TOCs in a database into one place. This is fine but I am wondering whether or not there is a way to make the updating less tedious, that is to automate it? Ideally what would happen is that whenever a change to the contents of any Group occurs the menu command “Create Table of Contents” would run, it would be named with the Group Name followed by the words “Table of Contents” (e.g. “Post-Processing Table of Contents”) and the old TOC would be moved to Trash. If I am right this should result in my TOCs to always be up to date.
I am posting it in this Forum as I guess the most likely solution is to create a script or an automator action. I would be most grateful for any suggestions.

Of course it is possible to do this. The scripting tools we have are a bit primitive, though. With the primitive scripts we users can create, monitoring “any change to a group” means monitoring all groups continually. Sort of like calling all of your neighbors to find out if the one you are looking for is at home. Puts a load on your computer. On the other hand, groups change because you did something to it – you know you did something to it, and so you are there when it changes. Aha - if I am sitting in my neighbors parlor I probably know he’s at home. So, why not run “Create Table of Contents” when you’re finished with that group? (Give it a keyboard shortcut to make it easier.)

That is basically what I try to do, or try to remember to do would be more honest :confused: And then delete the “old” TOC. This works fine once I have got past the remembering bit.

OK, here’s a nanny script. Attach it to any group or document, and each time you select that group it will natter you about that little task. 8)

on triggered(theRecord)
	tell application id "DNtp"
		display dialog "Update the table of contents" buttons {"I know, I know ..."} with title "Remember ..."
	end tell
end triggered

Thanks Korm. I like the thought that the older I get the more I need a “Nanny” :wink: