>>>So MHonArch received all the right options, but it still puts up the
>>>command line dialog which I have to click "OK" on. Is there any way
>>>to suppress the command line dialog when it's not needed? It kind of
>>>kills the automation aspect of all this. (although it's a great
>>>improvement to actually typing in the commands, of course)
>>
>>Hrm; what is the code in MHonArch that brings up the command line dialog?
>
>Like I said yesterday, to suppress the Dialog, alter line 66 of file 
>'mahamain' to read:
>
>       require 'osinit.pl';  &OSinit(1);
>         ------------------------------^


Too cool, this worked!  (BTW the file involved is "mhamain" not 
"mahamain"). Thanks a ton to Chris and Alan for the great help.


>Why? MacPerl::Ask() is called at line 102 of 'osinit.pl':
>
>       $cmdLine = &MacPerl::Ask( "Enter command line options:" );
>
>_unless_ $noOptions is defined. (See lines 96, 97, 98 osinit.pl).
>
>One way of setting $noOptions to 'true' is the modification of line 
>66 of 'mahamain' above. As I said there may well be a more elegant 
>way to do this.

Here are two sections of the "osinit.pl" script.:

>##     OSinit() checks what operating system we are running on set
>##     some global variables that can be used by the calling routine.
>##     All global variables are exported to package main.
>##
>##     Variables set:
>##
>##         $MSDOS      => Set to 1 if running under MS-DOS/Windows
>##         $MACOS      => Set to 1 if running under Mac
>##         $UNIX       => Set to 1 if running under Unix
>##         $VMS        => Set to 1 if running under VMS
>##         $DIRSEP     => Directory separator character
>##         $DIRSEPREX  => Directory separator character for use in
>##                        regular expressions.
>##         $PATHSEP    => Recommend path list separator
>##         $CURDIR     => Current working directory
>##         $PROG       => Program name with leading pathname component
>##                        stripped off.
>##
>##     If running under a Mac and the script is a droplet, command-line
>##     options will be prompted for unless $noOptions argument is
>##     set to true.
>##

<snip>

>     ##        Ask for command-line options if script is a Mac droplet
>     ##                Code taken from the MacPerl FAQ
>     if (!$noOptions &&
>       defined($MacPerl::Version) &&
>       ( $MacPerl::Version =~ /Application$/ )) {
>
>       # we're running from the app
>       local( $cmdLine, @args );
>       $cmdLine = &MacPerl::Ask( "Enter command line options:" );
>       require "shellwords.pl";
>       @args = &shellwords( $cmdLine );
>       unshift( @ARGV, @args );

Alan's suggestion to change the mhamain.pl from the original


>require 'osinit.pl';  &OSinit();

to

>require 'osinit.pl';  &OSinit(1);

Seems to work perfectly well, but I'm wondering if would somehow be 
better or more appropriate to change something in osinit.pl instead?

Curious to hear your opinions, then I'll forward this whole 
conversation to the MHonArc people...

Once again, thanks to everyone, my  basic problem seems very solved 
at this point! -Steve

Reply via email to