Reply to topic  [ 4 posts ] 
Batch modify rtf properties 
Author Message

Joined: 2017-12-22 00:17:36
Posts: 2
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?


2017-12-22 00:24:01
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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:
$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.


2017-12-26 14:09:40
Profile WWW

Joined: 2017-12-22 00:17:36
Posts: 2
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.


2017-12-26 14:30:19
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
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


2017-12-29 20:27:08
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software