Re: Integrating Unix scripting in Cocoa app
Re: Integrating Unix scripting in Cocoa app
- Subject: Re: Integrating Unix scripting in Cocoa app
- From: Ron Fleckner <email@hidden>
- Date: Thu, 9 Aug 2007 18:54:11 +1000
On 09/08/2007, at 10:17 AM, Nir Soffer wrote:
I would not use file extension to determine the way you run the
script because it does not give the user enough control and is not
the standard way to use scripts.
Either go with #! standard, or if you think it will be too hard,
provide an easy way to select script type, and maybe even handle
the script storage for the user, like Xcode or TextMate.
If you let the user manage scripts in the Finder like BBEdit, do
NOT force them to make the scripts executable. In the command line,
this make it easier for the user, but in your case, the user just
have to select the script from a menu - you should run the script
for the user. The user should not waste time chmod-ing files
because you are lazy :-)
Hey! I'm not lazy. Just ignorant and stupid. Actually, that's what I
wanted in the first place: to not have to require users to set the
script as an executable. I think that's been the root of the
longevity of this thread.
You can combine your easy to use way, #! line and file extension to
make everyone happy:
1. If the script has app meta data saved in your app - use it
meta-data-app path/to/script
What do you mean by 'meta-data' in this case? (Remember, I'm not
lazy, just...)
2. If the script has #!/path/to/app args... , use app with args to
run the script:
/path/to/app args... path/to/script
3. if the script has file extension, use the best guess for that
extension:
/usr/bin/env app path/to/script
4. let bash handle it :-)
/bin/bash path/to/script
Best Regards,
Nir Soffer
OK, all worth investigating. Thanks for your input.
Ron
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden