Minor Problem : application.showFileSaveDialog

I use this code:

var export_name = application.showFileSaveDialog( 'Invoice ’ + field_invoice_number + ‘.pdf’ );
application.writeFile(export_name , blob_field);

Works fine..But if i want to chancel the saving, i have to hit the ESC Key twice. Is there a way to chancel by pressing the escape key only once ?

Rainer

at what time do you have to press escape twice?
When the file save dialog is open?
I only have 2 press onces to close the dialog..

Yes, when the file dialog is open.
2 x esc for closing the dialog.
After closing the window with the suggested filename, another filesave window opens.

application.showFileSaveDialog();
//The window can be closed by pressing the escape key one time if used without any other function.

application.writeFile();
// Does not have a window.

I wonder why i have to press the escape key TWICE if i combine these two functions. Where does the need for the second escape come from ?

Rainer

You do that youreself in youre script.

var export_name = application.showFileSaveDialog( 'Invoice ’ + field_invoice_number + ‘.pdf’ );

If you press esscape here the export_name is null but you don’t test for it

application.writeFile(export_name , blob_field);

then this call sees a null value and asked you again for the dialog.

var export_name = application.showFileSaveDialog( 'Invoice ' + field_invoice_number + '.pdf' ); 
if(export_name)
{
  application.writeFile(export_name , blob_field); 
}

Problem solved :)

Great programm & great support :D

Rainer