• 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: Safari - downloading an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari - downloading an image


  • Subject: Re: Safari - downloading an image
  • From: "Gary (Lists)" <email@hidden>
  • Date: Mon, 22 Aug 2005 12:12:12 -0400

"Emmanuel" wrote:

> At 12:00 PM +0100 8/22/05, Rob Stott wrote:
>> I can't see an easy way of doing it with Safari, although that
>> doesn't mean there's not something clever that I've overlooked.
>
> In case it can help you save some time, I like Rob think it's not
> possible with Safari.
>
> Also, about URLAS: in case you are interested we have switched all
> our URLAS calls to curl, and as expected it works much better than
> before (while URLAS was not reliable unless you kill it from time to
> time.)
>
> I hope I am completely wrong :-)

Rejoice, your hope is reality.  :-) [1]


-- OK --------------------------------OSX.3.9-Safari1.3(v312)
-- just a document

set theURL to "http://orgdork.org/safari/AddSafariBookmark.html";

-- or a real download

set theURL to "http://orgdork.org/safari/AddSafariBookmarkv01b.zip";
set js to "document.location='" & theURL & "'"

tell application "Safari" to do JavaScript js in first document
--> tasty download
-- OK ------------------------------------------------------


You need to 'try...on error' on your own.

For example...

-- OK --------------------------------OSX.3.9-Safari1.3(v312)
set theURL to "http://orgdork.org/safari/AddSafariBookmark.html";
set js to "document.location='" & theURL & "'"
try
    tell application "Safari" to do JavaScript js in first document
on error m number n
    if n is 3 then display dialog "Open a new Safari window first."
end try
-- OK ------------------------------------------------------


HTH
--
Gary


[1] 08/19/2005 ... on some other list far away ...

>> "Gary" wrote:
>> I really do hope that I am completely wrong here,

>"Emmanuel" wrote:
> Rejoice, your hope is reality.  :-)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Safari - downloading an image
      • From: "Gary (Lists)" <email@hidden>
References: 
 >Re: Safari - downloading an image (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Invoking an Objective-C method from an Applescript
  • Next by Date: Re: Safari - downloading an image
  • Previous by thread: Re: Safari - downloading an image
  • Next by thread: Re: Safari - downloading an image
  • Index(es):
    • Date
    • Thread