Re: Google Chrome: Set variable to result of JavaScript
Re: Google Chrome: Set variable to result of JavaScript
- Subject: Re: Google Chrome: Set variable to result of JavaScript
- From: Cameron Knowlton <email@hidden>
- Date: Mon, 11 Jul 2011 14:03:33 -0700
Title: Re: Google Chrome: Set variable to result of
JavaScript
This probably isn't what you're looking for, but have you looked
at Fake?:
http://fakeapp.com/
It does Applescript/Javacsript integration extremely well.
Hope this helps.
Cameron Knowlton
At 1:28 PM -0700 11/07/11, Nathan Greenstein wrote:
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!
--
Nathan Greenstein
email@hidden
--
Cameron Knowlton
KnowledgeVine SEO Dashboards
email@hidden
P: 250.382.0226
http://www.knowledgevine.net
_______________________________________________
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