View Full Version : import files - name conflict

06 June 2008, 10:54 AM

I have alot of files that I need to import in to max. I've made a quick script which works great, but it stops at the second file with a name conflict dialog.

Is it possible to get max to autorename all name conflicts? (just click "OK" to the dialog)

the #noPrompt doesn't work for this.

06 June 2008, 11:53 AM
so much for 'no prompt', eh?

Here you go (3ds Max 9 and up)

fn checkDialog = (
local hwnd = dialogMonitorOps.getWindowHandle()
if (uiAccessor.getWindowText hwnd == "Import Name Conflict") then (
uiAccessor.PressButtonByName hwnd "OK"

dialogMonitorOps.enabled = true
dialogMonitorOps.unRegisterNotification id:#test
dialogMonitorOps.registerNotification checkDialog id:#test
importFile "c:\\test\\alpha.3ds" #noPrompt -- your code here
dialogMonitorOps.enabled = false

In short, the above code enables the dialog monitor, which lets maxscript know whenever a dialog pops up. When a dialog does pop up, it's checked to see if its title is "Import Name Conflict". If it is, then the "OK" button is pressed, otherwise it's left alone. Once the code is done, the dialog monitor is disabled again (as it does funky things to menus if you leave it enabled).

06 June 2008, 12:11 PM
nice hack.. works like a charm


CGTalk Moderation
06 June 2008, 12:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.