Page 1 of 1

Save As (and Save To) error

Posted: 2011-11-10 17:29:34
by tomoyuki-kosaka
I made the simple macro, which make a new document from selected text on the now editing document.

Code: Select all

$doc1 = Document.active
$text = Read Selection
$doc2 = $doc1.copy
Menu ':Edit:Select:Select All'
Menu ':Edit:Delete'
Select Document End
$doc2.insertText( $text, 'm' )
Save As

### end of macro ###
When I run this macro and saved the new file, always the error dialogue come as "Could not save the file"; however, the file is saved.
Is there anyone can solve this problem?
I'm using NWP 2.0.1 on macosx 10.6.8

Kosaka

Re: Save As (and Save To) error

Posted: 2011-11-11 00:58:55
by martin
That "could not save" message should not be displayed, sorry about that. I think what's going wrong is that the "Save As" command is expecting you to give it a destination path and not handling the save dialog properly.

Luckily there is a workaround. Instead of using the built-in Save As command, you can activate the menu directly, eg:

Code: Select all

Menu "Save As"

Re: Save As (and Save To) error

Posted: 2011-11-13 22:36:09
by tomoyuki-kosaka
Thank you, martin.

That's it!
Menu "Save As" works for my macro.
That "could not save" message should not be displayed, sorry about that. I think what's going wrong is that the "Save As" command is expecting you to give it a destination path and not handling the save dialog properly.
I remember this point.

Anyway, I appreciate your kindly support.

Kosaka