Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

frank131

macrumors newbie
Original poster
Sep 4, 2012
1
0
I need to use a binary file to automatically open a file. I have a program in my /usr/bin/ directory and I would like all files with the .fir extension to be opened by this program. The usual "right-click" and open with other application method simply doesn't work. I figured out a way to look at the /usr/bin/ directory but I cannot select any of the binaries. Using Mac OS X 10.8 I am wondering how I can make this happen. Is it even possible?

Please let me know!
 
No, it is not possible because the Finder uses AppleEvents to send the files you want to open, and this is not possible for command-line binaries. It also registers the applications that handle these extensions based on BundleID, and once again command-line binaries can't have BundleIDs.
 
Don't give up!

Use Automator to create an application which has only a single action, "Run Shell Script". Then type into the script
Code:
/usr/bin/programname "$@" &
and save it.

Now go to a file with that .fir extension in Finder. Cmd-I to Get Info. Under "Open with" search for and select the Automator generated application. Then click the "Change All..." button.

That's it!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.