I’m trying to write a code that if a certain button is pressed the “Finder” app in Mac OS X is opened in a specific path. I already have the code that works in Windows.
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
file.initWithPath(“C:\Windows\explorer.exe”);
let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(file);
let parameter = “/root,” + MY_SPECIFIC_PATH;
process.run(false, [parameter], 1);
So I tried to write one for Mac OS X.
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
file.initWithPath("/System/Library/CoreServices/Finder.app");
let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(file);
let parameter = “/MY/SPECIFIC/PATH”;
process.run(false, [parameter], 1);
I thought this should work, because the very similar code works for Windows and if you type command below in Mac’s Terminal it will work.
open /system/library/coreservices/Finder.app /MY/SPECIFIC/PATH
But the code doesn’t work in Mac OS X.
Can you help me with this?
Thank you very much in advance.
Also I’m trying to figure out the same thing for Linux Mint.