bogdan77 wrote:Hi there, first-time post
Hello bogdan77,
Welcome on board! I hope you will like it here.
bogdan77 wrote:As part of a larger script, I'm trying to automate saving the current document with a different name (docname + "_v01"), but Nisus throws a "Couldn't save document, AppleEvent handler failed" error
I tried your script, and it's flawless, as far as I can see. I did not get any error message.
How did you run it? Did you save it as a macro instead of saving it with AppleScript Editor as .scpt?
You can create a special AppleScript folder for your AppleScripts (in case you want to separate your AppleScripts from the Nisus macros), and put that special folder inside the Macro folder. Then you can run the scripts directly from the Macro menu. You can also assign a keyboard shortcut to your scripts in the same way as you would do to any normal macro.
You say your script is part of a larger script. Usually people write a macro if the process is going to take place within Nisus, and they only resort to an AppleScript if they need to exchange data with other programs. Thus you could fetch addresses from Contacts with an AppleScript, and then use this command at the end of the AppleScript in order to switch to NWP and hand over the data to a Nisus macro:
tell application "Nisus Writer Pro"
activate
Do Menu Macro with macro "Name of a Nisus macro as it appears in your macro folder"
end tell