The InDesign Scripting forum is a better place for this question, but you need to "save as" to a new file.
Thanks for the reply but "save as" will show a prompt to user.. and I want to change the name programmatically. Anyway thanks.
I'm sorry I did not explain better.
You want something like this:
Thanks Harbs.. It works for me..