Alias List or Repeat in 8.1
Alias List or Repeat in 8.1
- Subject: Alias List or Repeat in 8.1
- From: Bryan Kobler <email@hidden>
- Date: Wed, 19 Dec 2001 21:28:04 -0700
Hello,
I am still working on my transfer script. This script looks at a folder
and FTPs the contents to another place. What happens is the script
below....
tell application "Finder"
set aVar to every item of alias SourceFolder as alias list
end tell
That code will look inside a folder and make an alias list out of all
the folders inside, then Fetch can upload them. My problem is using
this line on a Mac OS 8.1 system, I am forced to use 8.1 on these
machines because certain software requires it. It seems 8.1 doesn't
understand "alias list" and using "alias as list" only works if there is
one folder inside of "SourceFolder". Does anyone know of a way to
modify this?
I have tried using the approach of looping to take each folder one at a
time. This is what I have tested but I am having trouble...
-- sets path to a folder on the desktop
set DeskPath to the path to desktop as string
set SourceFolder to (DeskPath & "test:") as string
-- counts the folders in SourceFolder, it runs the script for each
folder inside SourceFolder
repeat with m from 1 to length of SourceFolder
set SubFolder to (SourceFolder & item m of SourceFolder) as text
tell application "Finder"
set aVar to SubFolder as alias
end tell
-- Fetch uploads the files in the alias list to the server specified
tell application "Fetch 3.0.3"
activate
make new transfer window at beginning with properties
{hostname:"host", userid:"user", password:"password", initial
directory:"Documents/TestUpload"}
set transfer mode of transfer window "host" to Binary
put into transfer window "host" item aVar
quit Application "Fetch 3.0.3"
end tell
-- moves folder to "Transfered" folder after it has been uploaded
tell application "Finder"
move item aVar to folder (desktop & "Transfered:")
end tell
end repeat
When I run the above script what I expect to happen is set SubFolder to
(SourceFolder & item m of SourceFolder) as text to set the path to
"HD:Desktop Folder:test:<folder1>". <folder1> is replaced each time the
next folder in the repeat loop. What happens is <folder1> is replaced
with the first letter of the path. So my hard drive's name is "HD" and
what happens is I get this path... "HD:DesktopFolder:test:H". The next
repeat will make the path "HD:DesktopFolder:test:D".
Is there something I am missing for the script to replace <folder1> with
folder names?
Thanks, Bryan.