Re: Using exec("open", path)
Posted by
vischer on
Jan 20, 2015; 11:21am
URL: http://imagej.273.s1.nabble.com/Using-exec-open-path-tp5011289p5011299.html
Hi Michael,
> On Jan 20, 2015, at 00:17, Norbert Vischer wrote:
>
>> Hi,
>>
>> I would like to execute a command similar to the description of exec() in the documentation:
>> exec("open", path).
>> This works correctly when "path" points to a document that knows its creator (like Excel in case of results.xls)
>>
>>
>> When specifying any other application, I succeeded in OS X Terminal:
>> open "/Users/norbert/EightDots.txt" -a "/Applications/Igor Pro 6.2 Folder/Igor Pro.app"
>>
>> However, I cannot get it run from ImageJ.
> You could also try splitting the string yourself at the right points; if there are several arguments, ImageJ does not spit the individual arguments any more, even if they contain whitespace:
> exec("open", "/Users/norbert/EightDots.txt", "-a", "/Applications/Igor Pro 6.2 Folder/Igor Pro.app");
>
This works- and it is the most straight-forward method, so I didn't need to replace any spaces.
Wayne, perhaps this example could find its way into the documentation of exec() ?
Thanks a lot for this solution and best regards,
Norbert
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html