On 3/26/04 5:05 PM, "Simon Forster" <simon-lists at ldml.com> wrote: >>> The error seems to get thrown if the second command line arg is not >>> given - whether it's needed or not. >> >> I still get it, even if I add another argument. > > What error? "syntax error: No user interaction allowed. (-1713)"? Yes. It doesn't break the script, but it is inelegant. > >>> # hide -x - shows terminal >> >> Why? Since you're typing this from Terminal, it shouldn't matter. > > If I'm in the terminal and want to hide all apps except Mail but still > keep terminal showing, hide -ox Mail does this for me. Though it'd > probably be better to just allow you to specify multiple arguments for > the -o command. > > I'd decided to change the script so the commands were additive - > although most of them are mutually exclusive so it was a waste of time > - until I added the -x switch. Right, that's a point. > >> I wonder if the "begins with" and "contains" is any better/faster than >> simply "is -o" etc.? > > Additive switches. > >>> if "$1" contains "x" then tell application "Terminal" to activate >>> else if exists application process "$1" then >>> set visible of application process "$1" to false >> >> This part's not working for me... > > Hmm. Once again I need to supply 2 arguments. hide Mail Mail for > example works (for me). So how can we get it to work if two args are not supplied? That's a waste... It has something to do with the tell Finder bit. Kirk My latest book: How to Do Everything with Mac OS X Panther http://www.mcelhearn.com/htde.html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . kirk at mcelhearn.com | http://www.mcelhearn.com . . . . . . . . Kirk McElhearn | Chemin de la Lauze | 05600 Guillestre | France . .