Re: Saving a document in Safari
Re: Saving a document in Safari
- Subject: Re: Saving a document in Safari
- From: Philip Aker <email@hidden>
- Date: Mon, 10 Feb 2003 17:46:40 -0800
On Monday, February 10, 2003, at 04:17 PM, Rick Bargerhuff alias
cougar wrote:
For example, if I have opened an image or a sound file in a new
window, clicking "Save As" from the file menu saves the image or
sound file. This is what I am trying to do.
Hey Phillip!
Are you sure the "file" is being saved? Try emptying Safari's cache
and then reopen your document...
Yes. Simply open an image file in a new window (Open Image In New
Window) and click "Save As..." from the file menu. It will ask you
where to save the image. This works for any file, whether it be HTML,
image or sound file.
Well, I'm able to use this variant of JD's suggestion quite
successfully for that kind of HTML document:
tell application "Safari"
set urls to (get URL of every document)
repeat with i from 1 to count of urls
if item i of urls ends with "jpg" then
do shell script "cd ~/Desktop; curl -O " & item i of urls
end if
end repeat
end tell
Regarding this:
Ok, I did this before, I have used wget and curl but does not work.
The reason is, some sites have automated or recursive download
retrieval protection, meaning, soon as you download it, there is an ad
and the image is not there. http://www.fortunecity.com loves doing
this :( If you download it with a browser it works. So, if I could
get safari to save the document it is currently viewing, it would
work. But right now, this does not work.
If Safari has the goods, then it seems to me the item must be in it's
cache:
~/Library/Caches/Safari/
If one grabbed the contents of the cache before and after a particular
access, then one could obtain the last loaded file and perhaps grab the
data of of that file.
cd ~/Library/Caches/Safari ; find . ;
Gives a listing of the current contents of the cache. As to how a
Safari cache item is formatted, I don't know but it shouldn't be too
hard for someone to figure out.
Cheers,
Philip Aker
http://www.aker.ca
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.