Re: Execute Javascript on an HTML file
Re: Execute Javascript on an HTML file
- Subject: Re: Execute Javascript on an HTML file
- From: Jim Skibbie <email@hidden>
- Date: Fri, 26 Apr 2013 20:36:33 +0000
- Thread-topic: Execute Javascript on an HTML file
On 4/26/13, "Emmanuel LEVY" wrote:
>Not fully understanding the question: your proposition "tell application
>Safari etc." looks perfect, what's wrong with it?
>
>Best,
>Emmanuel
I'd prefer to not have to write the contents of the HTML string to a
document, then launch Safari just to run a snippet of Javascript on the
HTML document. The workflow really has nothing to do with Safari, and
having to save a document and open it in Safari just to parse it seems
like a lot of extra overhead. I was hoping someone might know of a way to
interact with an underlying Javascript framework that could be executed to
get the same result without having to utilize the Safari browser.
On 4/26/13, "Paul Berkowitz" wrote:
>As far as I recall, I don't believe that Outlook is any different from
>Entourage: 'content' of a message is just the plain text version of the
>message body, never the HTML version of multipart messages (which is what
>HTML messages are). It certainly can't be a file - it's just text. Are you
>saying that the message body consists of actual HTML code (copied from an
>HTML file), rather than an HTML message as such? In that case I guess you
>could proceed the way you're doing and, like Emmanuel, I wonder what the
>problem is. But if you're talking about an actual HTML message, you'd have
>to get the 'source', not the 'content', of the message and first parse it
>to
>get only the HTML part of the multipart source, and then proceed to your
>next steps. You'd have to look for " Content-type: text/html;" and trim
>what
>comes before <html>, then continue until </html>.
I can't speak for Entourage, but the Outlook dictionary provides three
different properties in the class: "messages" related to the content of
the message:
property: 'content'
type: 'text'
description: 'The HTML content of a message.'
property: 'plain text content'
type: 'text'
description: 'The content of a message as plain text.'
property: 'source'
type: 'text'
description: 'The raw source text of a message.'
The content property returns a string that is a fully formed HTML document
starting with the opening "html" tag ... ending with the closing "/html"
tag.
There is also a property to know if the message has html text.
property: 'has html'
type: 'boolean'
description: 'Indicates whether a message has html text?'
_______________________________________________
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