Thanks for this snippet.
I didn't want the running script to trigger a file open dialog, but to find out its 
own status by itself. With your script and the special variable $0, I have a complete 
solution to my problem.

Cheers
- -
#!perl

$_ = (&MacPerl::GetFileInfo($0))[1];
print /TEXT/? 'MacPerl':/APPL/? 'droplet': 'unknown',"\n";

__END__

On Sat, 23 Aug 2003 09:31:26 -0500,  Greenblatt & Seay wrote:

>For droplets the creator is "MrPL" and the Type is "APPL".

#!perl

use Mac::Files;
use Mac::StandardFile;

$file = StandardGetFile(0, 0);
$f = $file->sfFile() if ($file->sfGood());

($creator, $type) = &MacPerl::GetFileInfo($f);
print "$f\nCreator = $creator\n   Type = $type\n";

__END__

Reply via email to