Notifications
Clear all

[Closed] import files – name conflict

Hi,

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.

2 Replies

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"
 	)
 	true
 )
 
 dialogMonitorOps.enabled = true
 dialogMonitorOps.unRegisterNotification id:#test
 dialogMonitorOps.registerNotification checkDialog id:#test
 importFile "c:\	est\\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).

nice hack… works like a charm

thanks