Opening none Nisus files from Nisus (a query)

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

Opening none Nisus files from Nisus (a query)

Post by js » 2007-11-03 02:49:05

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: 4384
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2007-11-05 15:16:09

I'm sorry but I don't understand what you mean by "open a none Nisus file". Do you mean open a new document?

User avatar
gemboy27
Posts: 351
Joined: 2003-09-30 21:33:58
Contact:

non

Post by gemboy27 » 2007-11-05 16:27:50

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: 4384
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2007-11-05 16:54:16

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: 229
Joined: 2007-04-12 14:59:36

Post by js » 2007-11-06 12:25:36

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: 4384
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2007-11-06 15:12:40

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.

User avatar
gemboy27
Posts: 351
Joined: 2003-09-30 21:33:58
Contact:

Post by gemboy27 » 2007-11-06 16:12:55

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: 4384
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2007-11-06 16:18:54

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.

User avatar
gemboy27
Posts: 351
Joined: 2003-09-30 21:33:58
Contact:

:(

Post by gemboy27 » 2007-11-06 18:35:28

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: 229
Joined: 2007-04-12 14:59:36

Post by js » 2007-11-07 00:33:11

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: 4384
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2007-11-07 14:49:38

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