At 12:46 -0400 2001.04.25, Katherine Richmond wrote:
>I want to replace an AppleScript with a Perl stand-alone program. The
>AppleScript allowed a user to drag and drop an image file on it. It then
>presented a couple dialogs asking the user for a small amount of
>information. The script stores the information in the file's comment
>field. Then the script copied the image file over to a folder on another
>computer. Do you know if I can do this with MacPerl?
#!perl -w
use File::Basename;
use File::Copy;
use Mac::MoreFiles;
use strict;
my($dest) = "Williams:Desktop Folder:";
my($file) = @ARGV;
my($color) = MacPerl::Ask("What is your favorite color?");
FSpDTSetComment($file, "Color: $color");
copy($file, $dest . basename($file));
__END__
And this script works with MacPerl 5.6.1a1, too! :-)
Note: it assumes the target volume is mounted. Set the location variable
($dest) to the proper folder, and add in whatever questions you want, and
format the Comment string however you want.
--
Chris Nandor [EMAIL PROTECTED] http://pudge.net/
Open Source Development Network [EMAIL PROTECTED] http://osdn.com/