• 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: Bug with "attribute run" and Safari ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug with "attribute run" and Safari ?


  • Subject: Re: Bug with "attribute run" and Safari ?
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 11 Oct 2014 16:45:01 -0500

On Oct 11, 2014, at 15:21, quark67 <email@hidden> wrote:
Do you know how to use "attribute run" with Safari?
______________________________________________________________________

Hey There,

That looks like it goes back to Tiger.

As far as I know you cannot extract styled-text directly from Safari these days, although perhaps Shane can come up with a Mavericks/Yosemite Library to do it.

The only way I know is to use an html-to-rich-text tool like OSX's `textutil`

cat <file> | textutil -stdin -stdout -format html -convert rtf -encoding UTF-8

-------------------------------------------------------------------------------------------
tell application "Safari"
  tell front document to set ¬
    {_name, _src} to {name, do _javascript_ "window.document.documentElement.outerHTML"}
end tell
-------------------------------------------------------------------------------------------

Grab the source from Safari

Save it to a file to avoid problems with quoting and too much text on the command-line.

Run the shell-script from AppleScript or otherwise.

--
Best Regards,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bug with "attribute run" and Safari ?
      • From: Shane Stanley <email@hidden>
References: 
 >Bug with "attribute run" and Safari ? (From: quark67 <email@hidden>)

  • Prev by Date: Bug with "attribute run" and Safari ?
  • Next by Date: RESOLVED: Contacts Plugin AppleScript
  • Previous by thread: Bug with "attribute run" and Safari ?
  • Next by thread: Re: Bug with "attribute run" and Safari ?
  • Index(es):
    • Date
    • Thread