Thanks Thomas! This code will come in very handy.
At 12:56 PM +0200 2002/08/30, Thomas Wegner wrote:
>>#! perl -w
>use Mac::Navigation;
>
>$options = NavGetDefaultDialogOptions();
>$options->message("What's up, Doc?");
>$reply = NavChooseObject("", $options, undef, sub {1}) or die $^E;
If I click on "Cancel" I get the error message "# User canceled the
query (OS error -128)" and the program quits. I find it more useful
to change the preceeding line to...
$reply = NavChooseObject("", $options, undef, sub {1}) or $err = "$^E\n\n";
so that $err can be examined to see if it contains the word
"cancelled" so the program can continue.
>for ($i = 0; $i++<$reply->count; ) {
> print $reply->file($i), "\n";
>}
There is nothing returned in the first loop when '$i' is '0'. It's
neat that the user can shift click to select multiple files or use
the 'Select All' menu item to select all files in the dialog.
>(copied from the ChooseObjects.t test/example script)
Where can I find ChooseObjects.t? I installed MacPerl 5.6.1r1 using
the wonderful web updater but according to Sherlock I don't have any
'.t' files.
David Seay
http://www.mastercall.com/g-s/