Enhanced "Copy Formatted" command for Nisus Writer Pro

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
Philologist
Posts: 177
Joined: Fri Mar 20, 2015 9:17 am

Enhanced "Copy Formatted" command for Nisus Writer Pro

Post by Philologist »

I have Nisus Writer Pro as word processor in Bookends' Preferences. When I select one or more references in Bookends and then execute "Copy Formatted" from the Edit menu, formatted references are automatically entered into an open Nisus document. This is great. However, if there is *no* open Nisus document available, Bookends will

[1] copy selected references into the Clipboard
[2] switch to Nisus Writer Pro, and—because no open Nisus document is available—
[3] beep

I assume this is the intended behavior, but I wonder if it would be possible to enhance step [2] to call for the state of a Nisus document, i.e. find out whether an open Nisus document is available or not. If no document is available, a new document should be created instead of just beeping. This would make the "Copy Formatted" command much more effective.

Here is a Nisus macro that checks whether a document is open or not. Let's give it the name "Make sure there is an active Nisus document available".

Code: Select all

$doc = Document.active
$hasDoc = Defined $doc
If ! $hasDoc
	New
End
This macro could be called from Bookends with AppleScript:

Code: Select all

tell application "Nisus Writer Pro"
	Do Menu Macro with macro "Make sure there is an active Nisus document available"
end tell
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Enhanced "Copy Formatted" command for Nisus Writer Pro

Post by Jon »

In my case (NWP 2.1.6), if you close the NWP document and in Bookends do Command-K, when the switch occurs NWP opens a new document. Then a Command-V is all you need to do.

Jon
Sonny Software
Philologist
Posts: 177
Joined: Fri Mar 20, 2015 9:17 am

Re: Enhanced "Copy Formatted" command for Nisus Writer Pro

Post by Philologist »

In Nisus' Preferences > General > Application there is an option to determine what the application should do on activation (Do nothing, Create a new document, etc.). If the option "Create a new document" is selected, then a new document is indeed created as you say, but a beep is still played. I'm curious, do you also hear the beep, or is it just me?

Thank you for looking into this.
1.png
1.png (29.32 KiB) Viewed 5761 times
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Enhanced "Copy Formatted" command for Nisus Writer Pro

Post by Jon »

Yes, it beeps because Bookends doesn't get a confirmation that the Paste event was handled by NWP, and it's letting you know.

Jon
Sonny Software
Post Reply