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

Re: [MacPerl] APPLETALK question



What I would suggest:

Use the OSAX (Scripting Addition) "MountVolume" to mount the remote volume.
You can access it via Apple Events or AppleScript:

  use Mac::AppleEvents::Simple;
  $evt = do_event(qw/aevt mvol MACS/,
   q"VOLM:TEXT(@), SRVR:TEXT(@), ZONE:TEXT(@), USER:TEXT(@), PASS:TEXT(@)",
   'PowerPenguin', 'PowerPudge', '*', 'Pudge', 'password');

Or:

  MacPerl::DoAppleScript(<<EOS);
  MountVolume Volume "PowerPenguin" Server "PowerPudge" Zone "*" Â
    Username "Pudge" Password "password"
  EOS

Then you can just use File::Copy or something:

  use File::Copy;
  copy('PowerPenguin:Desktop Folder:file1',
       'PowerPudgeII:Desktop Fodler:file1');

So my final script would be like this:

  #!perl -wl
  use Mac::AppleEvents::Simple;
  use File::Copy;

  do_event(qw/aevt mvol MACS/,
   q"VOLM:TEXT(@), SRVR:TEXT(@), ZONE:TEXT(@), USER:TEXT(@), PASS:TEXT(@)",
   'PowerPenguin', 'PowerPudge', '*', 'Pudge', 'password') or die $!;

  copy('PowerPenguin:Desktop Folder:file1',
       'PowerPudgeII:Desktop Folder:file1') or die $!;

You just need to get Mac::AppleEvents::Simple (or use DoAppleScript) and
get the MountVolume OSAX, which should be online somewhere.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])



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