• 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
getting source in default web browser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting source in default web browser


  • Subject: getting source in default web browser
  • From: John Cochrane <email@hidden>
  • Date: Sun, 13 Apr 2003 23:45:25 +1000

Using scripts I have picked up from this list I have used Safari to get
information from web pages with

tell application "Safari"
set vText to text of document 1
set vtitle to name of window 1
copy the source of the front document to vContent
end tell

Of course to work properly this needs a page open in Safari.
To make the script portable I was trying to use the default browser to
achieve the same thing with

set browserType to word -1 of (do shell script "defaults read
com.apple.LaunchServices |grep -C5 E:html | grep -w LSBundleSignature
")
set {text:browserType} to (text of browserType) as text
set my text item delimiters to "."
tell application "Finder"
set browserPath to (application file id browserType) as alias
set browserName to first text item of (get name of browserPath)
end tell
set my text item delimiters to ""

tell application browserName
activate
set vText to text of document 1
set vtitle to name of window 1
--the above 2 lines work fine
--but if I try
copy the source of the front document to vContent
-->this line gets an error
end tell

Does anyone know why the error occurs and how to get the source of the
page?

John Cochrane
_______________________________________________
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.

  • Prev by Date: Re: Smile features?
  • Next by Date: Re: Smile features?
  • Previous by thread: Re: Personality settings in Eudora
  • Next by thread: Re: getting source in default web browser
  • Index(es):
    • Date
    • Thread