Enhanced "Copy Formatted" command for Nisus Writer Pro
Posted: Mon Nov 28, 2016 4:48 am
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".
This macro could be called from Bookends with AppleScript:
[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
Code: Select all
tell application "Nisus Writer Pro"
Do Menu Macro with macro "Make sure there is an active Nisus document available"
end tell