Having just read this blog item in Daniel Jalkut’s blog (he’s the author of FastScripts), I thought I’d post a link here because it’s a way to make Cocoa apps respond at a fundamental level (like the name of the window).
I’ve tried it, and it works very nicely because the Cocoa framework handles the script request for ‘standard’ scripting items. It’s as if the app had just the basic framework of scriptability, but that’s better than none. If I figure it out, I’ll write an AppleScript to do it.
Maybe he got the idea from you, Mark. Yours predates his. As the last poster in the thread you linked pointed out, Preview can often be made to respond to GUI scripting, for example in sizing a window, but I wanted to be able to get window names and hadn’t tried this (which works):
tell application "Preview" to activate
tell application "System Events" to tell process "Preview" to set N to name of window 1