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

Re: [MacPerl] mounting network servers



First of all, thanks to guinn@mail.utexas.edu (Tim Guinn) for the link:
<ftp://ftp.scriptweb.com//pfterry/applescript/osaxen/MountVolume.sit.hqx>

>>Is there a mechanism in MacPerl that would allow for
>>automated mounting of volumes on an AppleTalk network?
>
dmorley@stow.com wrote:
>i'm interested in this too, so please summarize what you discover and
>post. thanks much.
>
>--
>Darin S. Morley
>dmorley@stow.com
>http://www.stow.com/

After installing the OSAX into the scripting additions folder, calling the
following subs
worked with v. Mac_Perl_510a3:

sub mount_volume {
     my ($volume, $server, $zone, $username, $password)  = @_;

     unless (&MacPerl::DoAppleScript(<<_EOAS_)) {
       MountVolume Volume \"$volume\" Server \"$server\" Zone \"$zone\"
Username \"$username\" Password \"$password\"
_EOAS_

      print "Mount failed\n";
    }
}
# stray newlines in the MountVolume line aren't a good idea

sub unmount_volume {
     my ($volume) = $_[0];

     unless (&MacPerl::DoAppleScript(<<_EOAS_)) {
          tell application "Finder"
               if (list disks) contains \"$volume\" then
                    put away disk \"$volume\"
               end if
          end tell
_EOAS_

     print "Unmount failed\n";
     }
}




------------------------------------------------------------
John Whelan                                                ImageLinc Commercial
johnw@imagelinc.com                                  Internet Services
p: 206.812.2662                                         f: 206.812.1033