Re: associating arbitrary files to a script
I'm thinking of associating files with an arbitrary extension to a standard shell script so that when the file is double-clicked it automatically launches the script and is used as its argument. The file wants to be a 'unix executable'. Mine are simple text files with no extension, type = creator = 0, and the first line something like: #!/bin/tcsh -f Maybe starting with #! is enough. Use chmod to set the execute bits. -- Bill Ehrich ___ MacOSX-talk mailing list MacOSX-talk@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-talk
associating arbitrary files to a script
I'm thinking of associating files with an arbitrary extension to a standard shell script so that when the file is double-clicked it automatically launches the script and is used as its argument. Is there a relatively trivial way to do that ? Jean-Christophe Helary fun: http://mac4translators.blogspot.com work: http://www.doublet.jp (ja/en fr) tweets: http://twitter.com/brandelune ___ MacOSX-talk mailing list MacOSX-talk@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-talk
Re: associating arbitrary files to a script
On Wed, Jun 8, 2011 at 21:22, Jean-Christophe Helary jean.christophe.hel...@gmail.com wrote: I'm thinking of associating files with an arbitrary extension to a standard shell script so that when the file is double-clicked it automatically launches the script and is used as its argument. Is there a relatively trivial way to do that ? You may be able to do this by wrapping your script with something like Platypus. Or perhaps an AppleScript. I think associating a file type (or extension) requires a bundle identifier. I'm not sure that Platypus or an AppleScript provides this. -- arno s hautala /-| a...@alum.wpi.edu pgp b2c9d448 ___ MacOSX-talk mailing list MacOSX-talk@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-talk
Re: associating arbitrary files to a script
On 2011-06-08 19:39 , Arno Hautala wrote: On Wed, Jun 8, 2011 at 21:22, Jean-Christophe Helary jean.christophe.hel...@gmail.com wrote: I'm thinking of associating files with an arbitrary extension to a standard shell script so that when the file is double-clicked it automatically launches the script and is used as its argument. Is there a relatively trivial way to do that ? no You may be able to do this by wrapping your script with something like Platypus. Or perhaps an AppleScript. I think associating a file type (or extension) requires a bundle identifier. I'm not sure that Platypus or an AppleScript provides this. i understand that Platypus can do this; AppleSripts saved as an application bundle need some manipulation -- here's some info: http://www.macosxautomation.com/applescript/bundletools/index.html the key for this to work is that your resulting script wrapper must successfully handle the open event and receive the file(s) you have double-clicked, and pass those files as arguments to the shell script ___ MacOSX-talk mailing list MacOSX-talk@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-talk
Re: associating arbitrary files to a script
Steve, Arno, Thank you very much for the leads. I'll see what I can come up with. Jean-Christophe On 9 juin 2011, at 10:50, st...@paper-ape.com wrote: On 2011-06-08 19:39 , Arno Hautala wrote: On Wed, Jun 8, 2011 at 21:22, Jean-Christophe Helary jean.christophe.hel...@gmail.com wrote: I'm thinking of associating files with an arbitrary extension to a standard shell script so that when the file is double-clicked it automatically launches the script and is used as its argument. Is there a relatively trivial way to do that ? no You may be able to do this by wrapping your script with something like Platypus. Or perhaps an AppleScript. I think associating a file type (or extension) requires a bundle identifier. I'm not sure that Platypus or an AppleScript provides this. i understand that Platypus can do this; AppleSripts saved as an application bundle need some manipulation -- here's some info: http://www.macosxautomation.com/applescript/bundletools/index.html the key for this to work is that your resulting script wrapper must successfully handle the open event and receive the file(s) you have double-clicked, and pass those files as arguments to the shell script Jean-Christophe Helary fun: http://mac4translators.blogspot.com work: http://www.doublet.jp (ja/en fr) tweets: http://twitter.com/brandelune ___ MacOSX-talk mailing list MacOSX-talk@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-talk
Re: associating arbitrary files to a script
On Jun 8, 2011, at 6:22 PM, Jean-Christophe Helary wrote: I'm thinking of associating files with an arbitrary extension to a standard shell script so that when the file is double-clicked it automatically launches the script and is used as its argument. Is there a relatively trivial way to do that ? Not 100% sure it will work, but there is a third-party system preference pane called Default Apps that sounds like what you want. -- Macs R We -- Personal Macintosh Service and Support in the Wickenburg and far Northwest Valley Areas. http://macsrwe.com ___ MacOSX-talk mailing list MacOSX-talk@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-talk