InDesign 2024 open documents not recognized and/or not closing either

Can anyone help me? Even after rebuilding InDesign’s preference file, this script still shows ‘0 open documents,’ even though that’s not the case.

tell application id "com.adobe.InDesign"
	activate
	if (count of documents) > 0 then
		display dialog "There are " & (count of documents) & " open documents."
	else
		display dialog "No documents are open"
	end if
end tell

I also have a similar issue where script editor “doesn’t understand the close message” for a simple script such as this:

tell application id "com.adobe.InDesign"
activate
close document 1 saving no
end tell

I’m completely stumped and not sure what might be causing the issue on my computer or how to resolve it.

Looks like something is going wrong with InDesign’s AppleScript engine.

I’m sure you already tried to restart your Mac, right?

Also, try to uninstall-reinstall InDesign.

If it doesn’t help, try to create a clean new user account in System Settings and work from there - will it make a difference?

Thank you, Leo. This is the type of response I was hoping for to help point me in the right direction.

1 Like

Look in the InDesign dictionary and make sure they still have a document class.

You may need to use something like “document windows” rather than documents.

There are no such changes in InDesign. @Jeffkr’s scripts should work perfectly fine as they are. There’s some kind of anomaly which, hopefully, will be solved soon.

I really appreciate both of you responding. I wasn’t able to pinpoint the exact root cause, but it all started with a cloned machine. Coincidentally, during my troubleshooting, the issue was temporarily resolved by swapping InDesign preference files from another machine. However, the problem returned shortly after. Ultimately, I decided to re-image the Mac, which seems to have resolved the issue completely. Hopefully, it won’t return.

Thanks again,
Jeff