[X-Unix] Hiding apps from the command line

David Ledger dledger at ivdcs.demon.co.uk
Sat Mar 27 02:12:30 PST 2004


>Subject: Re: [X-Unix] Hiding apps from the command line
>From: Kirk McElhearn <kirklists at wanadoo.fr>
>Message-ID: <BC8A14EF.86C6C%kirklists at wanadoo.fr>
>
>On Fri, 26 Mar 2004 15:08:09 +0000, "Simon Forster" 
><simon-lists at ldml.com> wrote:

>>if "$1" contains "a" then set visible of every process whose 
>>visible is true and name is not "Finder" and name is not "$2" to 
>>false

>>  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.

	Change:
if "$1" contains "a" then set visible of every process whose visible 
is true and name is not "Finder" and name is not "$2" to false
	to:
if "$1" contains "a" then set visible of every process whose visible 
is true and name is not "Finder" ${2+and name is not \"$2\"} to false
	Do similar to '-o' line
	and change:
if "$1" contains "v" then tell me to tell application "$2" to activate
	to:
${2+if \"$1\" contains \"v\" then tell me to tell application \"$2\" 
to activate}

$var is replaced by the value of var
${var+some text} is replaced by nothing at all if var is unset, or by 
'some text' if var has a value
Here, the text introducing the use of the 2nd parameter is only 
included if the 2nd parameter is given.
See the man page for full details.  There is also ${var-}, ${var=} 
and ${var?} and more.

This 'here is' approach will only work with applications that have 
single word names.  '$*' would include the flags, so they need to be 
captured and shifted off first.  My solution at
<http://homepage.mac.com/david_ledger/Scripts/index.html>
gets round this.  You probably won't like my multi-char flags, but 
those can be changed to something that makes sense to you.

I do still get the error:
## Component Manager: attempting to find symbols in a component alias 
of type (regR/carP/x!bt)
but I get that in other places too.  Any ideas?

David


-- 
David Ledger - Freelance Unix Sysadmin in the UK.
Chair of HPUX SysAdmin SIG of hpUG technical user group (www.hpug.org.uk)
dledger at ivdcs.co.uk (also dledger at ivdcs.demon.co.uk)
www.ivdcs.co.uk



More information about the X-Unix mailing list