Two calls to URL Access Scripting ?
Two calls to URL Access Scripting ?
- Subject: Two calls to URL Access Scripting ?
- From: Doug McNutt <email@hidden>
- Date: Sat, 13 Jul 2002 13:14:48 -0600
I'm trying to convert some old code to use URL Access Scripting rather than Netscape or iCab which were once required for https. It now - in system 9.2 - appears that URL Access supports https. URL Access also returns a result so that I don't have to do funny things to wait for download completion. Those are good things.
My problem is that the Event Log shows duplicate calls to URL Access Scripting and I can't tell if it's really happening or if it's a bug in the logging process. It is persistent. I'm showing the whole mess below. Please excuse the length of the post and scroll down to ** Confusing duplicate lines ** below. Note that the duplicate download occurs only on the first of three subroutine calls.
*** begin AppleScript code ***
set theFile to "Luna:tmp:JNL.html"
set theURL to "
http://www.jnl.com/AUV/DAILY/perspective_dly.htm"
process(theURL, theFile)
set theFile to "Luna:tmp:GE.html"
set theURL to "
http://data.gelifeandannuity.com/unit_values/unitvalues_content.asp"
process(theURL, theFile)
set theFile to "Luna:tmp:PUT.html"
set theURL to "
https://www.putnaminvestments.com/individual/content/g/g5v_P.htm"
process(theURL, theFile)
set theHistory to "Luna:Documents:Finances:VAhistory"
set theDoneCheck to "Luna:tmp:FinCheck"
tell application "Finder"
try
delete file theDoneCheck
end try
open file "Luna:Projects:StockQuotes:VAscript" -- goes to toolserver and MacPerl
end tell
set izzitdone to false
repeat while izzitdone is false
tell application "Finder"
if file theDoneCheck exists then
set izzitdone to true -- does finder do this?
end if
end tell
if not izzitdone then
delay 5
end if
end repeat
tell application "Finder"
try
delete file theDoneCheck
end try
open file theHistory -- goes to MPWshell
end tell
on process(aURL, aFile)
try
tell application "Finder"
delete file aFile -- be sure we get a new copy
end tell
end try
with timeout of 180 seconds
tell application "URL Access Scripting"
download aURL to file aFile replacing yes without unpacking
end tell
end timeout
end process
***** Begin copy of Event Log *****
tell application "Finder"
delete file "Luna:tmp:JNL.html"
--> file "JNL.html" of trash
end tell
tell application "URL Access Scripting"
** Confusing duplicate lines **
download "
http://www.jnl.com/AUV/DAILY/perspective_dly.htm" to file "Luna:tmp:JNL.html" replacing yes without unpacking
download "
http://www.jnl.com/AUV/DAILY/perspective_dly.htm" to file "Luna:tmp:JNL.html" replacing yes without unpacking
--> file "Luna:tmp:JNL.html"
end tell
tell application "Finder"
delete file "Luna:tmp:GE.html"
--> file "GE.html" of trash
end tell
tell application "URL Access Scripting"
download "
http://data.gelifeandannuity.com/unit_values/unitvalues_content.asp" to file "Luna:tmp:GE.html" replacing yes without unpacking
--> file "Luna:tmp:GE.html"
end tell
tell application "Finder"
delete file "Luna:tmp:PUT.html"
--> file "PUT.html" of trash
end tell
tell application "URL Access Scripting"
download "
https://www.putnaminvestments.com/individual/content/g/g5v_P.htm" to file "Luna:tmp:PUT.html" replacing yes without unpacking
--> file "Luna:tmp:PUT.html"
end tell
tell application "Finder"
delete file "Luna:tmp:FinCheck"
open file "Luna:Projects:StockQuotes:VAscript"
--> file "VAscript" of folder "StockQuotes" of folder "Projects" of disk "Luna"
exists file "Luna:tmp:FinCheck"
--> true
delete file "Luna:tmp:FinCheck"
--> file "FinCheck" of trash
open file "Luna:Documents:Finances:VAhistory"
--> file "VAhistory" of folder "Finances" of folder "Documents" of disk "Luna"
end tell
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
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.
References: | |
| >Re: FM Pro ? (From: dave dowling <email@hidden>) |