Execute Javascript on an HTML file
Execute Javascript on an HTML file
- Subject: Execute Javascript on an HTML file
- From: Jim Skibbie <email@hidden>
- Date: Fri, 26 Apr 2013 14:12:10 +0000
- Thread-topic: Execute Javascript on an HTML file
I have a workflow where I'm pulling out the HTML source out of an email with:
tell
application "Microsoft Outlook"
set
theList to
current messages
set
theMsgContent to content of
item 1 of
theList
end tell
The variable theMsgContent is an HTML file which has some formatted HTML tables in it with data. I would like to execute
a chunk of _javascript_ on that HTML to parse out certain data out of it using something like:
document.getElementsByTagName('td');
Short of writing out the HTML file to disk and then opening it in Safari to perform a:
tell
application "Safari"
set
theResult to
do _javascript_ xyz
in tab
a
end tell
Is there a way to execute _javascript_ code on a file without involving the browser? Ideally, I'd like to do this with some resource that comes with a standard installation of OS software since this script will be distributed across multiple workstations
and I don't want to have to maintain a certain environment for the script to be able to run.
Thanks.
|
_______________________________________________
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