• 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: Safari source code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari source code


  • Subject: Re: Safari source code
  • From: Emmanuel <email@hidden>
  • Date: Sun, 20 Nov 2005 21:53:21 +0100

At 3:47 PM -0500 11/20/05, David Marshall wrote:
On Sun, 20 Nov 2005 03:53:16 +0000, kai wrote:

Is that really the name of the Safari document, dor? Either way, I'm
afraid you can't coerce a Safari document to text. Instead, you'll
need to get the required document property (in this case, source).

What about simply extracting the URL from the Safari page whose source is desired, and using URL Access Scripting to download the source (which is, after all, the same regardless of the browser being used)?


- - - - -

set thePath to path to desktop folder as Unicode text
set sourceFile to (thePath & "source.txt")
tell application "Safari" to set x to URL of front document
tell application "URL Access Scripting" to download x to sourceFile
tell application "TextEdit" to open sourceFile

- - - - -

(for an automated solution, prefer curl rather than URL Access Scripting, it's way more reliable)


(Emmanuel)
_______________________________________________
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


References: 
 >Re: Safari source code (From: David Marshall <email@hidden>)

  • Prev by Date: Re: Safari source code
  • Next by Date: Satimage Regex
  • Previous by thread: Re: Safari source code
  • Next by thread: Re: Safari source code
  • Index(es):
    • Date
    • Thread