AppleScript: I can't save the file with a different name
Posted: 2015-01-06 07:16:25
Hi there, first-time post,
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:
Any idea what am I doing wrong? 
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:
Code: Select all
tell application "Nisus Writer Pro"
if (count documents) is not equal to 0 then
set d1 to document 1
set fullPath to path of d1 as string
set parentPath to characters 1 thru -5 of fullPath as string -- here I get rid of the last four letters (the extension and its point)
save d1 in parentPath & "_v01.rtf"
end if
end tell
