Refresh record via AppleScript?

I’ve been looking for a way to refresh the current record (I’m updating a PDF via the filesystem and want to show the updated PDF). This is working:

set selection of think window 1 to {missing value}
set selection of think window 1 to {theRecord}

Is there a better way? I had hoped this had worked (so I don’t have to figure out which window is frontmost)

set selection to {missing value}
set selection to {theRecord}

Btw - it seems ‘selection’ doesn’t show as a property of think window in the AppleScript dictionary (it does show on viewer window).

Both viewer and document windows are think windows.

When I’ve opened a document (using double click) in its ‘own window’ it’s a viewer window, right? How can I determine what the document is in the front most window is - whether I’ve opened a separate window or it’s inside the ‘normal’ DT window?

Use if class of theWindow = and check for both, document window and viewer window.

A document window is the one that shows a single record (a single document).

A viewer window is the “main window”.

1 Like

Thanks. I’m now using this:

	if class of theWindow as string is equal to "document window" then
		set record of theWindow to theRecord
	else if class of theWindow as string is equal to "viewer window" then
		set selection of theWindow to {theRecord}
	end if