URL Access Scripting problem
URL Access Scripting problem
- Subject: URL Access Scripting problem
- From: "Marc K. Myers" <email@hidden>
- Date: Thu, 13 Jun 2002 12:37:17 -0400
- Organization: [very little]
I'm trying to build a script that extracts information from a URL,
<
http://www.plasticsurgery.org/lookup/show.cfm?ID=22>. There seems to
be something wrong with the way this server handles the http:// protocol
because URL Access Scripting times out after retrieving the page. It's
as if the "I'm through!" code isn't being sent.
I can work around this by wrapping the URL Access Scripting code in
"try...end try" and "with timeout of 5 seconds...end timeout", but this
results in more problems downstream. When I try to open the resulting
text file in Tex-Edit Plus I sometimes get an error message telling me
that the file is already open. I put a "try...end try" around the TE+
open statement in a loop that delays 5 seconds and trys the open again.
When the file finally gets opened control passes out of the error
handler. This seems to correct that problem.
This works fine for 5 iterations (retrieving 5 different pages on the
same server) but then my computer either freezes or I get a -619 error
(thread protocol error), depending on the way I've got the script
configured. It doesn't seem to matter whether I retrieve 5 pages in a
loop in the script or execute it 5 times retrieving one page at a time.
Can anyone give me a hint as to how I can get around this? Or if
there's another way to capture HTML pages in a text file that might deal
with this flakey server better? This is the relevant code:
try
with timeout of 5 seconds
tell application "URL Access Scripting"
download theURL to file filePath
end tell
end timeout
end try
tell application "Tex-Edit Plus"
repeat
try
open alias filePath
exit repeat
end try
delay 5
end repeat
[Do TE+ stuff here]
end tell
I'm running AppleScript 1.6 under Mac OS 9.2.1. TIA for any help.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[6/13/02 12:35:11 PM]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.