Notifications
Clear all

[Closed] How to set up a callback for closing a file?

I’m writing a logging tool to keep track of file versions and activity for our team, so I’m setting up log entries for when a file is opened and when it is closed. Since there isn’t actually a “closed file” callback, what would be the simplest way to achieve this?
I could write mulitple checks, such as when a new file is being opened or reset etc, but I thought I’d check if there was an easier flag.

5 Replies
1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

The only ways you can close a file are:

*File>New #systemPreNew
*File>Reset #systemPreReset
*File>Open #filePreOpen
*File>Quit #preSystemShutdown

For all of these, there is a callback. Just install 4 callbacks for these events and you will know when the current file has left the building…

im not sure if these callbacks will help…

#preSystemShutdown
#postSystemShutdown

but i suppose these are only useful if you’re shutting down max…
and yep, prolly writing multiple callbacks would do…

hope this helps:)

That’s one of the ones I’ll have to use, yes. So many different ways to close a file!

Why not use file open and file save callbacks (#filePreOpen, #filePostSave), etc.?

Or maybe have an intermediate “Checking In/Out” system, instead of the Open/Save dialogs.

Does anyone know if there are plugins out there that allows SQL to be used in maxScript? That could also help with databasing.

Thanks all. I guess there’s no other way then. It just feels a bit messy to have 4 callbacks for one function.

Onwards to glory! Thanks again guys.