I am trying to find a simple way to convert a bash script into a compact PPC application for Tiger and Leopard without third party applications or AppleScript.
The are many web pages saying that the following works and probably a similar number saying that it does not.
mkdir -p foo.app/Contents/MacOS
mv foo.command foo.app/Contents/MacOS/foo
chmod +x foo.app/Contents/MacOS/foo
It seldom works for my test script:
I normally get the following on Tiger: 'You cannot open the application "foo.app" because it is not supported on this system' and a similar message on Leopard.
I can sometimes get it working for a while if I modify an established working application but playing with it or rebuilding launch services database stops it working.
I would like to know why it fails. Is it that the hardware and software can support it but launch services and/or some other security inhibits it?
Can bash script be converted into a very small PPC application?
ok, after doing a quick test of your shell code on Mountain Lion (which worked), the main thing I can see that might cause issues is that your new-made pakage lacks an info.plist file. info.plist is where launchservices gets info it needs to open the package properly, and while launchservices probably has default values, the default values may not be appropriate in your case. With that in mind, create a file called info.plist in the Contents folder that contains some basic info:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
CFBundleIdentifier and CFBundleSignature are made-up values (they should be unique to this app). You may not need CFBundlePackageType and CFBundleSignature - those are the old-style file type and creator attributes that were phased out in os X, and there may be other attributes that you need to add - you'll have to compare with info.plist files in applications that work on your system.
creating the info.plist file can be done from the command line as well, but it's a bit more involved.
Sorry to take so long. I got it working. Diagnostics on Tiger very slightly better than Leopard. It did not need a plist. All the issues were with the bash file:
'say ping' does not work on my Tiger or Leopard it needs to be '/usr/bin/say ping'. Pity this error invoked such a misleading error message - see first post.
Thanks again for your help.