Re: puzzling Safari
Re: puzzling Safari
- Subject: Re: puzzling Safari
- From: Shane Stanley <email@hidden>
- Date: Fri, 27 Dec 2013 22:24:32 +1100
On 27 Dec 2013, at 7:42 PM, koenig.yvan <email@hidden> wrote:
When the asker got your answer he said : OK, it works but it doesn't. In fact we discovered that he was trying to save the contents of a page containing only a picture.
If he's using Mavericks or ASObjC Runner, it's simple enough in ASObjC. Here's a library handler:
use framework "Foundation"
on saveImageURL:thePicURL toPath:thePath set theNSURL to current application's NSURL's URLWithString:thePicURL set picData to current application's NSData's dataWithContentsOfURL:theNSURL picData's writeToFile:thePath atomically:true end saveImageURL:toPath:
And the calling script:
use theLib : script "<name of lib>" set thePath to POSIX path of ((path to desktop as text) & "Test.jpg") theLib's saveImageURL:thePicURL toPath:thePath
|
_______________________________________________
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