• 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
Re: Google Chrome: Set variable to result of JavaScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Google Chrome: Set variable to result of JavaScript (From: Nathan Greenstein <email@hidden>)

  • Prev by Date: Google Chrome: Set variable to result of JavaScript
  • Next by Date: Re: Google Chrome: Set variable to result of JavaScript
  • Previous by thread: Google Chrome: Set variable to result of JavaScript
  • Next by thread: Re: Google Chrome: Set variable to result of JavaScript
  • Index(es):
    • Date
    • Thread