Re: Put or get file from AS
Re: Put or get file from AS
- Subject: Re: Put or get file from AS
- From: Timothy Bates <email@hidden>
- Date: Sun, 28 Oct 2001 15:45:37 +1100
On 28/10/01 3:25 PM, "Craig Nansen" <email@hidden> wrote:
>
How can this script be modified to
>
a) allow a student to drop a file on the script and have it moved to
>
the shared folder on the server? (We don't support FTP on these
>
machines, so Fetch won't work for this.)
on open (thefile)
try
--mount volume "afp://user:email@hidden/NDATL"
tell application "Finder"
set thedrive to "Cortex"
try
move thefile to thedrive with replacing
end try
eject thedrive
end tell
on error m number N
try
tell application "Finder"
eject thedrive
end tell
end try
display dialog thedrive giving up after 10
end try
end open
>
b) allow us to move a specific file from the shared volume (such as
>
"quiz" or an "daily.html") to the computer that is running the script?
try
mount volume "afp://user:email@hidden/NDATL"
tell application "Finder"
set thedrive to NDATL
try
move thedrive & ":Applications (Mac OS 9):Apple
Extras:AppleScript:" to thedrive & ":Applications (Mac OS 9):Apple Extras:"
with replacing
end try
duplicate "Prelude:Apps:LabVIEW" to thedrive &
":C4A332WORKSTATIONS:" --with replacing
eject thedrive
end tell
on error m number N
try
tell application "Finder"
eject thedrive
end tell
end try
display dialog aVol giving up after 10
end try
>
Which raises a third question - since the file name would be the same
>
at each school, how can it be modified from the name on the server
>
"attendance" to a different name on my desktop "attendance001"?
tell application "Finder"
set x to duplicate file "Cortex:Users:tim:Desktop:mount perception lab"
to "Cortex:"
set name of x to name of x & ".001"
end tell
Dr Timothy Bates <
mailto:email@hidden>
Macquarie Centre for Cognitive Science (MACCS)
Macquarie University
Ph 61 (2) 9850 8623
Fx 61 (2) 9850 6059