• 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 a document in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving a document in Safari


  • Subject: Re: Saving a document in Safari
  • From: Rick Bargerhuff alias cougar <email@hidden>
  • Date: Sun, 09 Feb 2003 20:30:52 -0500

Hey JD & everyone else...

Why is it so difficult even for an experienced AppleScripter to save a document using AppleScript? I'm trying to code a script that will save the front most document of Safari to the desktop. No matter what syntax combination I try, I get an error.

Try this:

set f to "" & (path to desktop) & "junk.html"
tell application "Safari" to copy the source of the front document to s
set s to s as text
open for access file f with write permission
write s to file f
close access file f
tell application "TextEdit"
open {alias f}
activate
end tell

OK this works.. but only if I want to create a file based on the source (HTML Source). This does not solve my problem for
a sound or movie file, etc.

So thanks, but I'm looking yo save the document, not to create a text file from the HTML source. But again, thanks!

Cheers

Rick Bargerhuff alias cougar
Programmer / Developer
Multi-platform Technician / Specialist / Web Designer
Personal Email: email@hidden
Personal Website : http://mywebpages.comcast.net/cougar718
_______________________________________________
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.

  • Follow-Ups:
    • Re: Saving a document in Safari
      • From: John Delacour <email@hidden>
    • Re: Saving a document in Safari
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Saving a document in Safari (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Saving a document in Safari
  • Next by Date: Re: Saving a document in Safari
  • Previous by thread: Re: Saving a document in Safari
  • Next by thread: Re: Saving a document in Safari
  • Index(es):
    • Date
    • Thread