When are macros visible in the Finders Column view?

Everything related to our flagship word processor.
Post Reply
js
Posts: 229
Joined: 2007-04-12 14:59:36

When are macros visible in the Finders Column view?

Post by js » 2013-11-05 04:55:28

If I open the Nisus Macro Folder in the Finder, some macros can be read directly in the Finders Column View, but most show only the Nisus icon. Why is that?

User avatar
phspaelti
Posts: 889
Joined: 2007-02-07 00:58:12
Location: Japan

Re: When are macros visible in the Finders Column view?

Post by phspaelti » 2013-11-05 05:21:41

I'll say that I never noticed this before, but it seems to be due to whether the file is saved as plain text or not. Obviously perl macros are plain text, so you can see their code, and for a nisus macro it wouldn't matter if it is plain text or not (unless there are some attribute sensitive find statements in them). But I guess more recently Nisus saves macros (as rtf?) by default, and without the .rtf extension the Finder can't read them.

Well that's my interpretation of the facts anyway… :roll:
philip

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: When are macros visible in the Finders Column view?

Post by js » 2013-11-05 08:28:22

I was talking of standard Nisus macros, with the ending .nwm not on applescript or perl used by Nisus.
I did not find a clear indication about readability from the date of creation.
The interest of seeing the contents of macros is of course to let you find older models when you write a new one.
I am also astonished that the finder seems unable to search for words in the contents of macros, visible or not ...
I think it would be helpful if a Nisus person would clear up this little mystery.

User avatar
phspaelti
Posts: 889
Joined: 2007-02-07 00:58:12
Location: Japan

Re: When are macros visible in the Finders Column view?

Post by phspaelti » 2013-11-05 20:09:44

js wrote:I was talking of standard Nisus macros, with the ending .nwm
Well me too.
You can try the following little experiment. Save a .nwm macro as text. Then replace the .txt extension with .nwm. You will now find that you can read the macro in the finder no problem. And the macro still runs.
Now try the following. Save a macro as .nwm and then in the finder change the extension to .rtf. Presto! You will also be able to read it it in the finder. (But it won't appear in the macro menu anymore :( )

So you can see that .nwm files are just .rtf files with a funky extension.
philip

User avatar
martin
Official Nisus Person
Posts: 4251
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: When are macros visible in the Finders Column view?

Post by martin » 2013-11-06 17:55:04

Philip is exactly right here. NWP macro files are most often just stored using RTF codes inside, with a ".nwm" file extension. It's also possible to store plain text inside a ".nwm" file; NWP is just as happy to load that.

For whatever reason, the Finder will display a preview for the macros containing plain text, but is not smart enough to detect and decode the RTF. If we really wanted to solve this, NWP would have to come with a QuickLook generator that handles the ".nwm" extension and decodes the RTF.

User avatar
phspaelti
Posts: 889
Joined: 2007-02-07 00:58:12
Location: Japan

Re: When are macros visible in the Finders Column view?

Post by phspaelti » 2013-11-06 20:05:04

Maybe an option to save macros as text might be a simpler solution? (For some cases at least?)
philip

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: When are macros visible in the Finders Column view?

Post by js » 2013-11-07 09:43:44

Martin says:

For whatever reason, the Finder will display a preview for the macros containing plain text, but is not smart enough to detect and decode the RTF. If we really wanted to solve this, NWP would have to come with a QuickLook generator that handles the ".nwm" extension and decodes the RTF.
But my question at the outset was: Why does the Finder show the text of SOME Nisus ".nwm" macros with colors and all. And why does it not do the same for most of them. I cannot discover any difference. I have a number of Nisus Macros which are shown in the Finder as they should, the last two are from Sept 2010, but most older ones as well as newer ones don't show contents. I can't remember having done anything special for those that work.
Of course one could make text only macros, as phspaelti suggests, but I would like to keep the colors.


PS

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: When are macros visible in the Finders Column view?

Post by js » 2013-11-07 09:45:27

Martin says:
For whatever reason, the Finder will display a preview for the macros containing plain text, but is not smart enough to detect and decode the RTF. If we really wanted to solve this, NWP would have to come with a QuickLook generator that handles the ".nwm" extension and decodes the RTF.
But my question at the outset was: Why does the Finder show the text of SOME Nisus ".nwm" macros with colors and all. And why does it not do the same for most of them. I cannot discover any difference. I have a number of Nisus Macros which are shown in the Finder as they should, the last two are from Sept 2010, but most older ones as well as newer ones don't show contents. I can't remember having done anything special for those that work.

Of course one could make text only macros, as phspaelti suggests, but I would like to keep the colors.


PS

User avatar
martin
Official Nisus Person
Posts: 4251
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: When are macros visible in the Finders Column view?

Post by martin » 2013-11-07 14:49:31

js wrote:But my question at the outset was: Why does the Finder show the text of SOME Nisus ".nwm" macros with colors and all. And why does it not do the same for most of them. I cannot discover any difference. I have a number of Nisus Macros which are shown in the Finder as they should, the last two are from Sept 2010, but most older ones as well as newer ones don't show contents. I can't remember having done anything special for those that work.
I'm afraid I don't know why the Finder would have a preview for one ".nwm" containing RTF but not another. One hypothesis: at some earlier point (eg: OSX 10.6) the Finder was smart enough to recognize the RTF inside and generate a preview. These previews can be stored in the file's metadata, and perhaps it persists to this day?

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: When are macros visible in the Finders Column view?

Post by js » 2013-11-08 00:29:51

Martin wrote:
I'm afraid I don't know why the Finder would have a preview for one ".nwm" containing RTF but not another. One hypothesis: at some earlier point (eg: OSX 10.6) the Finder was smart enough to recognize the RTF inside and generate a preview. These previews can be stored in the file's metadata, and perhaps it persists to this day?
I think this is the right answer. It could explain the following: If you open a Macro with visible content and make whatever changement to the text, it is not visible any more afterwards.

User avatar
phspaelti
Posts: 889
Joined: 2007-02-07 00:58:12
Location: Japan

Re: When are macros visible in the Finders Column view?

Post by phspaelti » 2013-11-14 01:10:23

Just to come back to this once more. the following works and creates such a legible preview anytime you want:
  1. Change the macro extension to .rtf
  2. Open the macro, save, and close
  3. Change the extension back to .nwm
And the result is that you have a working macro and a legible preview.
Alternatively just save the macro as .rtf to begin with and then change the extension. (You need the .nwm extension, so that Nisus 'sees' the macro.)

Perhaps one could write some kind of apple script to do this (semi-)automatically?
philip

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: When are macros visible in the Finders Column view?

Post by js » 2013-11-14 15:33:39

Great.
It can be done by a Keyboard Maestro Editor macro. (Give it half a second pause after returns and press buttons "Use .rtf" and "Use .nwm" with a space before the dot.)

User avatar
Patrick J
Posts: 124
Joined: 2006-06-16 16:17:50
Location: Brighton & Hove, UK
Contact:

Re: When are macros visible in the Finders Column view?

Post by Patrick J » 2013-11-16 15:23:38

phspaelti wrote:Just to come back to this once more. the following works and creates such a legible preview anytime you want:
  1. Change the macro extension to .rtf
  2. Open the macro, save, and close
  3. Change the extension back to .nwm
And the result is that you have a working macro and a legible preview.
Alternatively just save the macro as .rtf to begin with and then change the extension. (You need the .nwm extension, so that Nisus 'sees' the macro.)

Perhaps one could write some kind of apple script to do this (semi-)automatically?
An AppleScript could of course be created to do this as I know you know but the simplest way is to use Automator and a very small bit of AppleScript.

In Automator there are the following actions in "Files & Folders" library:

Get Selected Finder Items
Rename Finder Items
Open Finder Items

And in the Utilities library there is the action:

Run AppleScript

With "Rename Finder Items" you can do a "Replace Text" in "extension only".

I think you will need a tiny AppleScript to close the Nisus Writer files, that is all, and this is because Nisus Writer doesn't install any Automator actions. I think it would be great if Nisus Writer did install some Automator actions actually.

I haven't created this Automator script myself, but I do use Automator a lot for file renaming and that kind of thing. I really like Automator :)
Patrick

Post Reply