Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Apps and Programs
AppleScript Help Needed
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="nabl" data-source="post: 979747" data-attributes="member: 43512"><p>Yeah, that's quite simple. I've used the command-line program <span style="font-family: 'Lucida Console'">curl</span> in my script, but you could just as easily tell Safari to download the file (though you'd then have to wait for Safari to launch).</p><p>[code]set imageURL to "http://www.google.com/images/srpr/logo1w.png"</p><p>set folderTarget to the POSIX path of the (path to the desktop)</p><p>set newImageName to "newimagename.png"</p><p>display dialog (folderTarget as string) & newImageName</p><p></p><p>do shell script "curl " & imageURL & " -o " & folderTarget & newImageName[/code]</p><p>I've used the Google logo and am saving it to a file called newimagename.png on the desktop. However, there are a few problems with my script. First, you have to put the URL into the script itself, and you also have to specify the filename (and filetype) for it to work. Basically, it's not much more efficient than going to the website and saving the image manually.</p><p></p><p>If you give a more specific account of what exactly you want to automate, I could help you work toward a much better AppleScript.</p></blockquote><p></p>
[QUOTE="nabl, post: 979747, member: 43512"] Yeah, that's quite simple. I've used the command-line program [font="Lucida Console"]curl[/font] in my script, but you could just as easily tell Safari to download the file (though you'd then have to wait for Safari to launch). [code]set imageURL to "http://www.google.com/images/srpr/logo1w.png" set folderTarget to the POSIX path of the (path to the desktop) set newImageName to "newimagename.png" display dialog (folderTarget as string) & newImageName do shell script "curl " & imageURL & " -o " & folderTarget & newImageName[/code] I've used the Google logo and am saving it to a file called newimagename.png on the desktop. However, there are a few problems with my script. First, you have to put the URL into the script itself, and you also have to specify the filename (and filetype) for it to work. Basically, it's not much more efficient than going to the website and saving the image manually. If you give a more specific account of what exactly you want to automate, I could help you work toward a much better AppleScript. [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
AppleScript Help Needed
Top