I'm afraid that attachments are either not working or they take a very long time to appear in the forum.
You'll get a faster response if you provide more information (that might have been in your capture), for example:
Which scripting language? Which version of InDesign? What code did you use? What error message did you get?
Actually I didn't try it through script. While manually export to pdf it throws an error at end of the process as "Failed to export the PDF file" or sometimes quits the application.
Then why have you posted in the InDesign Scripting forum? You'd be better off in the main InDesign forum.