octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opening unknown file types in external applications


From: Patrick Noffke
Subject: Re: opening unknown file types in external applications
Date: Tue, 23 Apr 2013 16:27:27 -0500



On Tue, Apr 23, 2013 at 4:06 PM, John W. Eaton <address@hidden> wrote:
On 04/23/2013 02:58 PM, Torsten wrote:


OK, that works great to open files with their default applications,
but what's the best way to recognize the files that should be opened
in the Octave GUI's built-in editor?

I don't see a general way to override the default editor or disable
editing of text files so that openURL will return some kind of "sorry,
I don't know how to open that file" status so that we can handle them
internally in Octave.  So it seems that we need to recognize the files
we want to handle first, then call openURL.  But nothing that I can
think of (lists of filename patterns, binary vs. ASCII text, the Unix
file program) really seems like a complete or reliable solution.

Any ideas?


Can you associate file types (maybe only using extensions, such as .m) with octave, and register that with the OS during an install?  Then when you call openURL, a new instance of octave will start.  Then maybe you can detect that and pass the URL to the existing instance (or that could be a setting -- whether or not to allow multiple instances).  My Windows text editor (UltraEdit) can work that way -- pass to existing instance or create a new instance if configured that way.

Then maybe you can also get the "Open With" OS option, to at least give the option to open with octave.

Another thing UltraEdit has is a dialog to choose which extensions are associated with that application.

Here's a link for associating a file type with an application on Windows:
http://stackoverflow.com/questions/1387769/create-registry-entry-to-associate-file-extension-with-application-in-c

Pat

reply via email to

[Prev in Thread] Current Thread [Next in Thread]