• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving Safari documents as html?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving Safari documents as html?


  • Subject: Re: Saving Safari documents as html?
  • From: David Duncan <email@hidden>
  • Date: Fri, 6 Jan 2006 13:39:40 +1100

Nigel Garvey wrote at 5 Jan 2006 15:02:53 +0000

I think you're supposed to save the document rather than the window,
though the effect seems to be the same, in Safari 2.0.2. Strange. (I
can't tell about images because my Tiger machine's not connected to the
Net.) If the file's renamed after it's saved, Safari recognises it as an
HTML file rather than a download file:


   tell application "Safari"
    activate
    set fileName to (name of document 1) & ".html"
    set savePath to (path to desktop as Unicode text) & fileName
    save document 1 in file savePath
  end tell

  tell application "Finder"
    if file (savePath & ".download") exists then
      set name of file (savePath & ".download") to fileName
    end if
  end tell

This worked perfectly. Thank you, Nigel, for such excellent advice.

David Duncan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Making Folders
      • From: Steve Suranie <email@hidden>
  • Prev by Date: Re: How do I delete the 1st three characters from a variable
  • Next by Date: Re: How do I delete the 1st three characters from a variable
  • Previous by thread: Re: Saving Safari documents as html?
  • Next by thread: Making Folders
  • Index(es):
    • Date
    • Thread