AppleScript名:web上の画像をローカルにダウンロードして保存 |
— Created 2013-12-27 Shane Stanley use AppleScript version "2.4" use scripting additions use framework "Foundation" set thePicURL to "http://www.macosxautomation.com/applescript/apps/gfx/EverydayCover300.jpg" set thePath to POSIX path of ((path to desktop as text) & "Test.jpg") set aRes to saveImageURLToPath(thePicURL, thePath) on saveImageURLToPath(thePicURL, 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 saveImageURLToPath |
More from my site
(Visited 115 times, 4 visits today)