Scripts in Finder

Discussion in 'Mac Apps and Mac App Store' started by radek42, Jun 13, 2012.

  1. radek42 macrumors regular

    May 27, 2008
    Here, there, and everywhere

    I just learnt that one can make click-able shell scipts in finder which is a great news.

    However, I was wondering if one can have shell scrips that will execute on particular file groups using write-click in finder.

    For example:
    I have a shell script that will compile *.tex file, updates references, and produces pdf file. I can run it from terminal and it works.

    I'd like to be able to find m *.tex file in Finder. Upon using right-click I'd like to be able to select my script and run it. Can automator be deployed in Finder to execute shell scripts?

    Right now I fairly comfortable with bash scripting, but know pretty much nothing about apple-script. That might of course change once I run my mac full time. But then again, I find shell scripts "universal" across platforms which is a plus.

    As always, I appreciate any comments and/or suggestions.

    Cheers, Radek
  2. kryten2, Jun 13, 2012
    Last edited: Jun 13, 2012

    kryten2 macrumors 6502a

    Mar 17, 2012
  3. radek42 thread starter macrumors regular

    May 27, 2008
    Here, there, and everywhere
    Thanks, that sounds good. I am on Lion; I should have said that in my original message.


  4. radek42, Jun 27, 2012
    Last edited: Jun 27, 2012

    radek42 thread starter macrumors regular

    May 27, 2008
    Here, there, and everywhere
    Coming back to this post after finally getting my Air ....

    I went through the links and I do not believe it really answers my question. What I was hoping to do is this:

    1. say I have data file "parabola.dat" that has two columns of numerical data;

    2. I do have a bash script that takes two-column data file, runs gnuplot (CLI plotting program), and displays my data in a 2d scatter plot;

    3. I now want to be able to go to Finder and find my "parabola.dat" file. When I click on the file I'd like to have an option to select my script described above to plot my data straight from Finder. This functionality is built-in into linux file browsers such as thunar or nautilus.

    Can anybody tell me if this is possible in Finder? If not in finder, is there different file browser for OSX that can do that?

    Thanks. R>


    Added: It seems that perhaps Path Finder has that functionality?
  5. ytk macrumors regular

    Jul 8, 2010
    One possibility is to build your script into an app using Platypus. Set it to accept dropped .dat files, then put the resulting app in /Applications. You should now be able to open ".dat" files by right clicking on them and selecting "Open With" (you may have to specify the app the first time, but after that it should be available whenever you click on any .dat file). Alternatively, you can get info any .dat file, tell it to open using your newly created app, and then make that the default for all .dat files. Then just double clicking on any .dat file should open it with your app.

Share This Page