URL Access Scripting Problem
URL Access Scripting Problem
- Subject: URL Access Scripting Problem
- From: email@hidden
- Date: Thu, 31 Jan 2002 15:02:34 -0600
I have a strange problem with a script I have using for a while. It runs
fine on my G4 with OS 9.1 and Applescript 1.5.5. It won't run on a G4 with
OS 9.2.2 and AS 1.8.2b1 (thanks everyone for the help finding this update
yesterday). The script is long and I am going to post just the section that
is causing me a headache. The problem is with the variable "missingListVar".
If I let the script run and define the variable it defines it as a list,
{"wiz17qsl.tif", "wiz17qsc.tif"}. This result was cut and pasted out of the
"observe" window in Scripter. URL Access scripting though gives me the error
"URL Access Scripting got an error: Can't make some data into the expected
type", when it prepares to download this file.
If I set the variable myself and hard code it into the script, by adding the
line:
set missingListVar to {"wiz17qsl.tif", "wiz17qsc.tif"}
then the script will run. Why would this be? They seem to be exactly the
same to me. Am I missing something? Here is the script section:
----------------------------------------------------------
--this first line is the one I had to add to get it to run
set missingListVar to {"wiz17qsl.tif", "wiz17qsc.tif"}
set pubDate to "0423"
--variable below is the path to FTP site
set mainURL to "
ftp://ftp.ftpsite.com/directory/directory/"
--pathNameVar is for local path
set pathNameVar to {"File Server:directory:directory:", pubDate, ":"} as
string
--repeat loop for pulling from ftp
repeat with dirVar in missingListVar
if number of characters in dirVar = 12 then
set dirVar2 to characters 1 thru 3 of dirVar as string
else
set dirVar2 to characters 1 thru 2 of dirVar as string
end if
--fileName is the file name on this loop thru repeat, as string
set fileName to dirVar as string
--finalFileName is the full path to the features folder with the current
comic name attached
set finalFileName to {pathNameVar, comicName} as string
--currentURL is the variable with path to file that is being FTP'ed on this
loop thru repeat
set currentURL to {mainURL, pubDate, "/", dirVar2, "/", fileName} as string
with timeout of 1800 seconds
tell application "URL Access Scripting"
download currentURL to finalFileName replacing yes with progress and
unpacking
end tell
end timeout
end repeat
----------------------------------------------------------
The bottom line is, if the script sets the "missingListVar" variable it does
not work. If I copy and paste the result of the script setting the variable
and use that to define the variable, then it works.
Thanks in advance. If any of this doesn't make sense, let me know and I will
attempt to clarify.
Jim Scharosch
Mac System Administrator
Gazette Communications
319-368-8669
email@hidden