• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is this AppleScript working unreliably? Any ideas?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is this AppleScript working unreliably? Any ideas?


  • Subject: Re: Why is this AppleScript working unreliably? Any ideas?
  • From: Jeff Gold <email@hidden>
  • Date: Tue, 12 Oct 2010 00:44:29 -0400

Good suggestion, Santa.

I've removed the try - end try statements, and these are the error messages I got:

1) The first time the script is run I get the following error as soon as it hits the first download statement:
error "URL Access Scripting got an error: An error of type -31040 has occurred." number -31040

2) The second time the script is run I get this different error as soon as it hits the first download statement:
error "URL Access Scripting got an error: Connection is invalid." number -609

3) Here's the odd thing, as I mentioned in the first post.  The third time and subsequent times I hit "run" with this identical script, it works just fine.  No errors.

Then after some period of time, it will stop working again.  Once again, it will take the "magic" 3 tries to get the script running again.  Any ideas?

- Jeff


P.S. Here's the script again:

	set filetoget1 to ("http://www.SOMEDOMAIN.com/VALIDPATH1/VALIDFILENAME1.jpg";)
	set downloadpath1 to "Macintosh HD:VALIDPATH1:VALIDFILENAME1.jpg"
	set filetoget2 to ("http://www.SOMEDOMAIN.com/VALIDPATH2/VALIDFILENAME2.jpg";)
	set downloadpath2 to "Macintosh HD:VALIDPATH2:VALIDFILENAME2.jpg"
	set filetoget3 to ("http://www.SOMEDOMAIN.com/VALIDPATH3/VALIDFILENAME3.jpg";)
	set downloadpath3 to "Macintosh HD:VALIDPATH3:VALIDFILENAME3.jpg"
	tell application "URL Access Scripting"
		download filetoget1 to downloadpath1 replacing yes
		****** THIS IS WHERE ERROR MESSAGES DESCRIBED ABOVE COME UP ***
		download filetoget2 to downloadpath2 replacing yes
		download filetoget3 to downloadpath3 replacing yes
	end tell
	set attachment1alias to downloadpath1 as alias
	set attachment2alias to downloadpath2 as alias
	set attachment3alias to downloadpath3 as alias
	set myAttachments to attachment1alias & attachment2alias & attachment3alias
	set mySMTP to "00.00.00.00"
	set myFrom to "RETURNADDRESSHERE"
	set myTo to "email@hidden"
	set mySubject to "subject of email to send"
	set myBody to "body text of email to send"

	send email myBody ¬
		subject mySubject ¬
		from myFrom ¬
		to myTo ¬
		via host mySMTP ¬
		attaching myAttachments ¬

	tell application "Finder"
		delete downloadpath1
		delete downloadpath2
		delete downloadpath3
		empty the trash
	end tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why is this AppleScript working unreliably? Any ideas?
      • From: Alex Zavatone <email@hidden>
References: 
 >Re: Why is this AppleScript working unreliably? Any ideas? (From: Jeff Gold <email@hidden>)
 >Re: Why is this AppleScript working unreliably? Any ideas? (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Why is this AppleScript working unreliably? Any ideas?
  • Next by Date: Re: Why is this AppleScript working unreliably? Any ideas?
  • Previous by thread: Re: Why is this AppleScript working unreliably? Any ideas?
  • Next by thread: Re: Why is this AppleScript working unreliably? Any ideas?
  • Index(es):
    • Date
    • Thread