Login  Register

Re: isMacintosh boolean in a macro?

Posted by Gabriel Landini on Oct 11, 2008; 11:15am
URL: http://imagej.273.s1.nabble.com/isMacintosh-boolean-in-a-macro-tp3694802p3694804.html

On Saturday 11 October 2008, Bill Mohler wrote:
> Is there an easy way to detect the OS from in a macro, so I can
> substitute in the correct punctuation?  I assume that ImageJ is aware
> of its environment, but how do I ask it?



Yes, search for "os" in this page:
http://rsbweb.nih.gov/ij/developer/macro/functions.html

you will find this:

getInfo(key)
Returns the Java property associated with the specified key
(e.g., "java.version", "os.name", "user.home", "user.dir", etc.). Returns an
empty string if there is no value associated with the key. See also:
getList("java.properties"). Requires 1.38m.

which is what you want, I think.
I hope it helps
Cheers

G.