Login  Register

(Macro) argument substitution and backslash handling, problem with windows file association

Posted by Joachim Wesner on Jul 19, 2009; 7:39am
URL: http://imagej.273.s1.nabble.com/GenericDialog-programmatic-OK-tp3691723p3691726.html

Hi list

(I see that this has already been discussed partly in another thread, but
in a different context...)

I was trying to do the following:

I have set up a Windows file association that should lauch ImageJ and an
associated plugin when the user click on a certain file (extension) via
something like

"c:\imagej\imagej.exe -eval "run('Plugin Name', 'file=%1' )"

Launching the plugin works as expected, but when passing the
(automatically) appended file name by %1, it only contains singe
backslashes which are already dropped somewhere on the chain to
the plugin (I use Macro.getOptions as described in the Wiki FAQ), because
they are parsed as "\x" control characters (actually not even that, it
seems only a few known combinations are  converted,
on "unsusual" ones, the "\" is simply dropped, but the character after it,
remains)

However, I do not (yet see) a way to force windows to use "/" or double the
"\\", so automatic filename passing won´t work this way.

Any ideas to fix or circumvent this?

Could probably the newly added "drag and drop" support be made use
configurable, so that one could like plugins to a certain extension? This
would also avoid launching a new ImageJ instance (probably including it´s
own JVM) as in my approach

Sincerely


Mit freundlichen Grüßen / Best regards

Joachim Wesner


Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht
Wetzlar  HRB 2432
Geschäftsführer:  Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy
Martyr | Colin Davis
www.leica-microsystems.com


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________