Set the user interaction level to ignore each and every warning:
// The script does not display any dialogs or alerts. app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
and make sure this gets reset after your script is done -- because otherwise, InDesign will not display any dialogs and alerts at all:
// The script displays all dialogs and alerts. app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
even though the description says "The script ...", this applies to the entire program, not just 'the script'.
cool.... thanks.... i can complete my work lol.....
Actually, i did the save as action by script before process this function. Anyway, I will try this script as well.....coz the script looks cool too.....