Batch modify rtf properties

Everything related to our flagship word processor.
Post Reply
jmm
Posts: 2
Joined: 2017-12-22 00:17:36

Batch modify rtf properties

Post by jmm »

I realize it is possible to modify keywords or authors of single rtf files in Nissus Writer Pro. But I need to do it for a large number of files. Could anybody advise me how to do it in Terminal, with an Applescript or any other app?
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Batch modify rtf properties

Post by martin »

It should be possible to accomplish your task directly in Nisus Writer using a macro. Here's an example macro that's quite straightforward. It will ask you to choose one or more files (in a standard file dialog) and then set the author and keywords to some fixed pre-determined values.

Code: Select all

$filePaths = Choose Files
ForEach $filePath in $filePaths
	$doc = Document.open($filePath)
	$doc.setProperty("author", "Dr Seuss")
	$doc.setProperty("keywords", "chartreuse, ova, piggy")
	Save
	$doc.close
End
More complex macros are possible of course, but hopefully this gets you started.
jmm
Posts: 2
Joined: 2017-12-22 00:17:36

Re: Batch modify rtf properties

Post by jmm »

It seems very time consuming to open and save each file if processing a large number of rtfs.
I wonder if this could be handled by Applescript for batch processing.
Or does Nisus provide actions for workflows regarding document properties, as Microsoft Word does for Automator?
Thank you.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Batch modify rtf properties

Post by phspaelti »

jmm wrote:It seems very time consuming to open and save each file if processing a large number of rtfs.
Have you tried Martin's macro? You can select lots of files and it will go through all of them and change them accordingly.
jmm wrote:I wonder if this could be handled by Applescript for batch processing.
You could save the central part of Martin's macro and then write an applescript, that uses that and applies it to relevant selections of files via an applescript.
But alternatively you could write a Nisus macro that goes through the file hierarchy and changes all relevant files in the path. NWP's ability to manipulate files is no more cumbersome than applescript's, so you don't gain much from using applescript.
Which solution you choose, really depends on your set-up, and what you are trying to achieve. Do you have a regular stream of files that need to be changed in this way?
jmm wrote:Or does Nisus provide actions for workflows regarding document properties, as Microsoft Word does for Automator?
Automator isn't really good for anything. Who uses that?
philip
Post Reply