 |
 |
Applescript to write file to disk using IE...
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status:
Offline
|
|
I think I am almost there, but cannot figure out the last part. The IE dictionary refers to the ability to access a specific url, then optionally write the file to disk. Here is a copy/paste from the IE dictionary:
GetURL: Open the URL (and optionally save it to disk)
GetURL string -- URL to open
[to 'fsswhich to save resource located at URL.
...I am a bit green when it comes to Applescript. I have the first part working great (GetURL "www.foo.com/whatever/image.gif") however, I do not understand the [to 'fss'] reference. Obviously, this is the reference to writing the file to disk, but I don't know how to express this. My objective is to get the file into a specific directory (start up disk:System Folder: Appearance: Desktop Pictures:image.gif)
Thanks in advance for everyone's help!
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 1999
Location: Edmonton, Alberta, Canada
Status:
Offline
|
|
> how to express this. My objective is to get the
> file into a specific directory
tell application "Internet Explorer 5"
GetURL "www.foo.com/whatever/image.gif" to file "start up disk:System Folder: Appearance: Desktop Pictures:image.gif"
end tell
you could also use URL access scripting if you are running (i believe) 8.6 or higher. to download or upload a file.
hope that helps
|
|
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status:
Offline
|
|
I have moved to URL Access Scripting... you're right. I have it working now, the only thing I haven't figured out is how to set the explicit path when I don't know what the name of the hard disk is. Any thoughts there? I'd imagine that there must be a way to simply "find" the Appearance folder, right?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status:
Offline
|
|
Ahhhh, figured it out:
--code snip
set picture file of monitor 1 to alias ((path to desktop pictures folder as text) & the item_name)
--end code snip
Small accomplishment I know, but now I've got a groovy little script that goes to a url, downloads a file, then makes the background image of the monitor that file.
Now I need to learn how to iterate the selection of a file (001.jpg, 002.jpg, etc) in my initial query as well as how to set a timer to automatically check for a new file every "x" days/weeks whatever.
Any pointers are always appreciated.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status:
Offline
|
|
Re: running at timed intervals.
Now that you have your script running there are two ways to get it to go off at a certain time. One way is to use iDO Script Scheduler. I think this is still distributed by Apple as part of the system install (or maybe just on the install disk as a separate install). If it isn't there look on the web. You install iDO and then pick the times and/or intervals you want scripts to run.
The other way is through an "on idle" handler. You just have to put "on idle" at the top of your script and "end idle" at the end. One line before the "end idle" you need a "return 60". Substitute the 60 for the number of seconds you want to pause between runnings. Every hour would be 3600. Do a save as of your script and make sure it is saved as an application and that "stay open" is checked.
To test it you have to click it from the finder. Script Editor won't run "on idle" scripts from the editor. Just launch your new application and it will perform its steps every X number of seconds.
Kind of long, but hope this helps.
-numero
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|