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

Re: [MacPerl] Simple Open Dialog



>#!perl
>
>$show_dialog	= "tell application \"Finder\"\n";
>$show_dialog.=		"activate\n";
>$show_dialog.=	"try\n";
>$show_dialog.=	"set file1 to choose file with prompt \"Select a file:\"\n";
>$show_dialog.=	'on error -- e.g. user cancelled' . "\n";
>$show_dialog.= "return\n";
>$show_dialog.= "end try\n";
>$show_dialog.= "end tell\n";
>
>MacPerl::DoAppleScript($show_dialog);

Rather convoluted, don't you think?  Why not:

#!perl -w

$show_dialog = <<EOS;
tell application "Finder"
    activate
    try
    set file1 to chose the file with prompt "Select a file:"
    on error -- e.g. user cancelled
    return
    end try
end tell
EOS      

MacPerl::DoAppleScript($show_dialog);
  

# Fungal Parataxonomy                   Mycology Information (Mycoinfo)
# Webmaster, Staff Writer      **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/> 
# "A couple of guys trying to do something great..."



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch