Re: Copy files inside a folder
Re: Copy files inside a folder
- Subject: Re: Copy files inside a folder
- From: "Marc K. Myers" <email@hidden>
- Date: Thu, 29 Nov 2001 01:35:52 -0500
- Organization: AppleScriptsToGo
>
Date: Wed, 28 Nov 2001 13:50:00 -0700
>
From: Bryan Kobler <email@hidden>
>
Subject: Re: Copy files inside a folder
>
To: email@hidden
>
>
Thanks for the tips! I got this working in the Finder just great. Now
>
I need to adjust it to work in Fetch 3.0.3. I have found that things
>
work a little different there. This is what I have...
>
>
===
>
set SourceFolder to choose folder
>
>
tell application "Fetch 3.0.3"
>
activate
>
make new transfer window at beginning with properties
>
{hostname:"server", userid:"username", password:"password", initial
>
directory:"/Users/user/Documents/test"}
>
put into transfer window "server" item alias SourceFolder
>
quit Application "Fetch 3.0.3"
>
end tell
>
===
>
>
If I run that script it will upload the folder I select at the beginning
>
of the script. My problem is trying to get Fetch to understand
>
uploading the files inside of SourceFolder I have tried including parts
>
of the scripts you have suggested. I can't use:
>
>
put into transfer window "server" every file of item alias SourceFolder
>
>
So I guess Fetch works a bit different than the Finder. Anyone have any
>
experience with that?
The problem is that your "every file" reference is a part of the Finder
and not part of Fetch. In a Finder tell block, set a variable to "every
folder" and coerce it with "as alias list". This will load the variable
with a list of aliases to the files. All applications (mostly)
understand aliases. Then use the variable in your Fetch command.
Note: there's a bug in Finder that blows you up if there is a single
item and you try to use the "as alias list" coercion. You have to trap
the error like this:
tell application "Finder"
try
set aVar (to every file of alias "someFolder") as alias list
on error
set aVar (to every file of alias "someFolder") as alias as list
end try
end tell
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[11/29/01 1:35:20 AM]