Google Chrome: Set variable to result of JavaScript
Google Chrome: Set variable to result of JavaScript
- Subject: Google Chrome: Set variable to result of JavaScript
- From: Nathan Greenstein <email@hidden>
- Date: Mon, 11 Jul 2011 13:28:42 -0700
Hi all,
I've been trying to get Chrome to do some _javascript_ in a tab, and set the result of that to an AppleScript variable.
Here's my code:
tell tab 1 of mywindow to set x to execute _javascript_ "return document.getElementById('mydiv').innerHTML;"
This works, but x is just set to missing value.
set x to tell tab 1 of mywindow to execute _javascript_ "return document.getElementById('mydiv').innerHTML;"
This won't compile.
I know the JS is good, because if I have Chrome alert() instead of return it works fine.
So, is this a bug somewhere or am I doing something wrong? Is there a way to get this to work?
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