copying files

Ken Ray kray at sonsothunder.com
Wed Feb 5 13:11:01 EST 2003


OK guys, here's how you do it... first the raw commands themselves:

Macintosh (using AppleScript):
===================
You do a "duplicate to". The following AS example copies a file on the root
of my hard disk (named "Enterprise") to the Applications folder:

tell application "Finder"
  duplicate file "Enterprise:Test File" to "Enterprise:Applications:"
end tell


Windows (using Shell):
=================
You use the "copy <src> <dest" command. Here's an example (assume by main
drive is "C" and the file is "Test File.txt", and I want to copy it to a
folder called "Stuff" on the "C" drive:

  copy "C:\Test File.txt" "C:\Stuff\Test File.txt"

You have to use quotes if you have spaces in the file name.

If you want the generic "copy file" MetaTalk code handler, let me know. But
try setting it up yourself if you can (better to teach a person how to fish
than to give them a fish, you know...)

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


----- Original Message -----
From: <FMoyer at aol.com>
To: <metacard at lists.runrev.com>
Sent: Wednesday, February 05, 2003 11:31 AM
Subject: Re: copying files


>
> In a message dated 2/4/03 1:02:52 PM, rcs at rcsprogramming.com writes:
>
> >Could somebody PLEASE tell me how to copy a file using Applescript in
> >MetaCard? An example unsing shell would be much appreciated too...it does
> >not have to be extensive (I am doing error checking before and after the
> >actual copy). I just need to use something other than the built in copy
> >routines in Metacard.
>
> Copying a file must be a common need among MC programmers. Has anyone done
it
> who would be willing to share their script? I need something
cross-platform,
> and the file that I'll be copying is large, so it's not practical to load
the
> entire file into ram. Thanks a lot!
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>




More information about the metacard mailing list