• 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
Execute Javascript on an HTML file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Execute Javascript on an HTML file
      • From: Paul Berkowitz <email@hidden>
    • Re: Execute Javascript on an HTML file
      • From: Emmanuel LEVY <email@hidden>
  • Prev by Date: Re: how to script QT to export file to mp4 format?
  • Next by Date: Re: Execute Javascript on an HTML file
  • Previous by thread: how to script QT to export file to mp4 format?
  • Next by thread: Re: Execute Javascript on an HTML file
  • Index(es):
    • Date
    • Thread