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

Re: [MacPerl] Selecting files from MacPerl



The easiest way without delving into the toolbox is to use StandardFile.pl
provided with the MacPerl distribution. There is no pod for it but the
comments explain it well enough. You can find it under :lib: (in the MacPerl
folder).

-K

> From: David Wadson <wadsond@air.on.ca>
> Date: Fri, 11 Aug 2000 23:22:12 -0400
> To: macperl@macperl.org
> Subject: [MacPerl] Selecting files from MacPerl
> 
> 
> I've been lurking for a longtime, keeping my eye on the list but not having
> many questions since I'd generally been programming for a Unix box. Anyways, I
> finally had a project that specifically required a Perl program on the Mac and
> while I got most of it working, I ran into a snag. The help files were very
> vague on how to select files to open or save using the standard Mac dialog
> boxes. I hacked a workaround by running an AppleScript from the script to
> choose the file the user wants to manipulate and passing the result to the the
> script:
> 
> $import_sourcefile = MacPerl::DoAppleScript(<<END_SCRIPT);
> tell application "Finder"
> return choose file of type "TEXT"
> end tell
> END_SCRIPT
> A rather inelegant solution I thought. For saving the file, I had the script
> set the name and destination for the file rather than letting the user input
> their own name and save location. Even more inelegant.
> 
> Well, I'd really like to cleanup the script and use MacPerl to let the user
> pick the input file and save the output file in the location of their choice.
> But I can't seem to find any decent help or examples only "Access to Inside
> Macintosh is essential for proper use of these functions. Explanations of
> terms, processes and procedures are provided there." in the help file. Does
> anyone know where I can find a tutorial or have the proper usage of open and
> save dialogs?
> 
> Thanks for all the assistance,
> 
> David Wadson - wadsond@air.on.ca
> Composing Foreman
> 
> The Chronicle-Journal
> Thunder Bay, Ontario, Canada
> www.chroniclejournal.com
> # ===== Want to unsubscribe from this list? # ===== Send mail with body
> "unsubscribe" to macperl-request@macperl.org
> 


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