Opening none Nisus files from Nisus (a query)

Get help using and writing Nisus Writer Pro macros.
Post Reply
js
Posts: 259
Joined: 2007-04-12 14:59:36

Opening none Nisus files from Nisus (a query)

Post by js »

It is easy to use the Nisus macro language to open other Nisus files. I use a macro that closes the front file and pastes "Open" plus its pathway into the file that becomes visible if the topmost one is closed by the macro Then you can select it and use "Run selection as Macro". It's an effective method to make references among Nisus files.
Now I wonder whether it is possible to open a none Nisus file with the Nisus macro language. Is it possible to send an instruction as an Apple event that opens a none Nisus file?
Thanks for any suggestions.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

I'm sorry but I don't understand what you mean by "open a none Nisus file". Do you mean open a new document?
gemboy27
Posts: 355
Joined: 2003-09-30 21:33:58

non

Post by gemboy27 »

could JS mean 'non-nisus' file
I have never let my schooling interfere with my education/Mark Twain (1835-1910)
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

Thanks, that makes sense gemboy, especially in the context of the rest of his comment.

All macro commands that manipulate/open Nisus files can be used on non-Nisus files as well. For example, if you have a plain text file on your desktop you could open it like so:

Code: Select all

Open '~/Desktop/file.txt'
js
Posts: 259
Joined: 2007-04-12 14:59:36

Post by js »

Martin answered:
All macro commands that manipulate/open Nisus files can be used on non-Nisus files as well. For example, if you have a plain text file on your desktop you could open it like so:

Open '~/Desktop/file.txt'
My question was meant somewhat differently: Let's say I work in a project with different applications and their documents involved, the main document being a Nisus document. Can a Nisus macro give instructions to open those non-Nisus files of the project in their own applications? If the Nisus macro language cannot do that by itself, can it maybe give such instructions by calling Apple events or by help of Perl?
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

If you simply want to open a file in the default application associated with the file, you can use the Open URL command as follows:

Code: Select all

Open URL ‘file:///Users/shortname/Desktop/whatever.ext’
If you need to launch/use a specific application then I think you'll have to dip into AppleScript.
gemboy27
Posts: 355
Joined: 2003-09-30 21:33:58

Post by gemboy27 »

Open URL ‘file://localhost/Applications/MarsEdit.app’

I want to open marsEdit by clicking on a link, that I embed in a template

I've figured out a short cut via iKey, but really miss that one click

I understand that OSX.5 is different...but...

do you have any suggest for a work around
I have never let my schooling interfere with my education/Mark Twain (1835-1910)
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

You're talking about the hyperlink feature you mentioned in this thread, correct? Hmm, you might try creating an alias to the MarsEdit application, and then inserting a hyperlink to that alias in your NWP document.
gemboy27
Posts: 355
Joined: 2003-09-30 21:33:58

:(

Post by gemboy27 »

you are absolutely right
and I am still depressed
about it
I have never let my schooling interfere with my education/Mark Twain (1835-1910)
js
Posts: 259
Joined: 2007-04-12 14:59:36

Post by js »

martin wrote:If you simply want to open a file in the default application associated with the file, you can use the Open URL command as follows:

Code: Select all

Open URL ‘file:///Users/shortname/Desktop/whatever.ext’
If you need to launch/use a specific application then I think you'll have to dip into AppleScript.
Thanks, Martin. This allows me to make a hyperlink from my Nisus file to a non Nisus file, f.e. to open a MindManager chart that belongs to a project, directly from the Nisus project file. Great.

There remains a little problem though: If the file name is more than one word, the Nisus macro is unhappy. I tried to drag the icon of such a onto a Terminal window, wich sets the \ signs before spaces. But this still does not work. Can spaces (or other incompatible characters) in file names be dealt with in another way?
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

js wrote:There remains a little problem though: If the file name is more than one word, the Nisus macro is unhappy. I tried to drag the icon of such a onto a Terminal window, wich sets the \ signs before spaces. But this still does not work. Can spaces (or other incompatible characters) in file names be dealt with in another way?
This looks like a bug. I'll see if we can get this fixed for the forthcoming NWP 1.0.2 release. In the meantime you can use "%20" instead of a space to work around the problem, eg:

Code: Select all

Open URL 'file:///Users/shortname/Desktop/two%20words.ext'
One note: in this case, once we've fixed the bug this workaround will fail.
Post Reply