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

[MacPerl-Modules] Toast Folder 1.0



#!perl -w

# ToastFolder v1.0
# by Jeff Lowrey <lowrey@mailbag.com>
#
# Use with Adaptec's Toast to give the cd being made
# a different name than the name of the item.
# This script is a minor step saver.
#
# Revision history
# 1.0
#   * First release.

use strict;
use Mac::Glue;

my $toaster = Mac::Glue->new('Toast_3_5_6');
#Change to whatever you called your Adaptec Toast glue

my @files = @ARGV;
if (scalar(@files) > 1){
	die "Dropping more than one item is not supported currently.  Sorry!";
};

#Process the folder path to get the name of the folder.
#Could have checks to see if $files[0] is a folder, but that's not important.
my @path = split (/:/,$files[0]);
my $foldername = $path[-1];
my $answer = MacPerl::Ask('What do you want to call the new cd?',$foldername);
$path[-1] = $answer;
rename ($files[0],join(":",@path));

#make the new disc and write it
$toaster->activate();
$toaster->make('new'=>'mac_files___folders_disc');
my $currentDisc = $toaster->get($toaster->prop('current_disc'));
$toaster->add_to($currentDisc,items=>(join(":",@path)));
$toaster->write($currentDisc);

#Restore the folder to it's original name
rename (join(":",@path),$files[0]);

__END__



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