Always open file with this application with /usr/bin/?

Discussion in 'macOS' started by frank131, Sep 4, 2012.

  1. frank131 macrumors newbie

    Joined:
    Sep 4, 2012
    #1
    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!
     
  2. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #2
    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.
     
  3. talmy macrumors 601

    talmy

    Joined:
    Oct 26, 2009
    Location:
    Oregon
    #3
    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!
     

Share This Page