Home » Questions » Computers [ Ask a new question ]

Open a file type with shell script in OS X

Open a file type with shell script in OS X

I'm trying to figure out if it's possible to program the open action (double clicking on a file) for a given file extension in OS X as:

Asked by: Guest | Views: 261
Total answers/comments: 2
Guest [Entry]

"The only way is to package the script as an app.

For portability, you can simply create an AppleScript container that will execute the shell script you created.

Check out do shell script for more information.

When you go to save the script, be sure to save it as an ""Application"" or ""Application Bundle""."
Guest [Entry]

"You should be able to right click a file and ""Get Info"". Under ""Open with"" you can select the script you want to open the filetype with and also check the ""Change All"" button.

This should change the filetype to open with your script."