Save As (and Save To) error

Get help using and writing Nisus Writer Pro macros.
Post Reply
tomoyuki-kosaka
Posts: 41
Joined: 2009-02-17 17:44:12

Save As (and Save To) error

Post 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
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Save As (and Save To) error

Post 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"
tomoyuki-kosaka
Posts: 41
Joined: 2009-02-17 17:44:12

Re: Save As (and Save To) error

Post 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
Post Reply