[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Need help with txt2pdf v2.5 and MacPerl 5.20r4



Taylor Leaming <macbert@prismnet.com>, wrote:

>After wrestling with how to create a droplet from a 34+Kbyte file (had to
>"export to droplet" from the MacPerl menu of BBEdit 5.1.1).  Next, I managed
>to craft a small AppleScript to call this droplet and pass it some command-
>line parameters...

The first is SOP.  The second is the HARD way to do it.

I suggest instead, adding the following lines EARLY in the script:

if ($^O eq 'MacOS') {
   if (@ARGV < 0) {
       $mac_answer = eval "MacPerl::Ask(
          'Enter Command-Line Options', ''
          )";
       push(@ARGV, split(' ', $mac_answer))
   }
}

With this addition, the script when run in the normal fashion (rather 
than as a droplet) will put up a dialog box asking for the command line 
options.  If you wish to provide a set of defaults, the second parameter 
of MacPerl::Ask() is the content of the text field.

There may be other issues specific to text2pdf, which I'm not familiar 
with, but in general, this is how I deal with command-line options.  If 
the program ONLY takes a filename as its argument, a droplet is fine.

Oh, I see they've got a funky (in a Perl context) SHARWARE license.  Keep 
the modified code to yourself!  Kinda hard to SELL Perl programs, but we 
must respect their wishes regardless of how foolish they seem to be. (uh, 
pay your shareware fee?) Oh, and version 3.2 must came out this morning...

--B


Brian McNett, Webmaster
*************************************************************
Mycoinfo. The world's first mycology e-journal.
http://www.mycoinfo.com/
*************************************************************


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org