OS X: support the `open` command
Posted: Thu Mar 08, 2012 5:57 pm
The open command
On OS X, Apple provides a super-handy open command. It’s a versatile command with many, many uses. Check out the manpage for several examples.
One of my favorite uses is this:
This opens the application appName no matter where it is.
This is super useful if you don’t know the path—or if you don’t want to have to type a really/really/really/long/path .
Taking that one step further, you can use the command:
Which open the application and passes it args.
The open command and Oxygen apps
I just tried doing this with DiffFiles:
But it didn’t work.
What About DiffFilesMac.sh?
Indeed! It’s a useful script. And I do use it. It works well.
However:
Can Oxygen apps please support accepting arguments from the open command?
On OS X, Apple provides a super-handy open command. It’s a versatile command with many, many uses. Check out the manpage for several examples.
One of my favorite uses is this:
Code: Select all
open -a appName
This is super useful if you don’t know the path—or if you don’t want to have to type a really/really/really/long/path .

Taking that one step further, you can use the command:
Code: Select all
open -a appName [ args… ]
The open command and Oxygen apps
I just tried doing this with DiffFiles:
Code: Select all
open -a DiffFiles file1.xml file2.xml

What About DiffFilesMac.sh?
Indeed! It’s a useful script. And I do use it. It works well.
However:
- it’s a very/long/path/to/my/oxygen/directory
- open is an OS X provided command that has been around forever. (In fact, it first appeared in NextStep—it’s older than OS X!) It’s powerful, flexible, and it’s not going anywhere.
- 99% of the time, I can use it to launch any application without typing a path for the application or any arguments. I don’t even have to symlink anything! It “just works”.
Can Oxygen apps please support accepting arguments from the open command?
