• 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: rendering HTML on the fly with Webkit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rendering HTML on the fly with Webkit


  • Subject: Re: rendering HTML on the fly with Webkit
  • From: Christopher Nebel <email@hidden>
  • Date: Thu, 14 Jul 2005 10:49:08 -0700

On 05.7.13 6:25 AM, "Mikael Byström" <email@hidden> wrote:

I want to render HTML from my email client PowerMail with Webkit (or similar capable standard installed application) stored in a variable before rendering and in another after. However, I don't know how webkit scripting is supposed to best be done and I have trouble even understanding how to script it. I didn't find anything I could understand in the archives. It is possible to script Webkit, no?

So what I want in pseudo code:

Tell application PowerMail

set theMessages to current messages
repeat with m in theMessages
set theHTML to source of m
set theHeaders to headers of m
set theHTML to theHTML - theHeaders

Tell Application Webkit
set theText to render(theHTML)
end tell

set the source of m to theHeaders & theText
end tell

So can Webkit render HTML on the fly or must it have an URL? How can I get to it with scripting? Where is the dictionary? I tried to open the framework with Script Debugger, but it was grayed out. I'm not experienced enough to know how to get to frameworks, so advice would be welcome.

As a matter of fact, I don't believe that WebKit has ever had AppleScript bindings added to it, so strictly speaking, no, you can't script it. However, depending on what you want to do, the number of methods you'd need to call can be quite small, so it's not an insoluble problem.


However, I'm not quite sure what it is that you want to do. You speak of "rendering" HTML, which usually means taking a glob of HTML and displaying it in an on-screen view like it looks in a web browser or whatnot, but your sample code looks more like it's trying to reduce the HTML to plain text, which is quite a different problem. Can you clarify?


--Chris Nebel AppleScript and Automator Engineering

_______________________________________________
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:
    • Re: rendering HTML on the fly with Webkit
      • From: Mikael Byström <email@hidden>
References: 
 >Re: rendering HTML on the fly with Webkit (From: Takaaki Naganoya <email@hidden>)

  • Prev by Date: Re: Tiger Desktop Position of Disks
  • Next by Date: Re: Distiller Question
  • Previous by thread: Re: rendering HTML on the fly with Webkit
  • Next by thread: Re: rendering HTML on the fly with Webkit
  • Index(es):
    • Date
    • Thread