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: Christopher Stone <email@hidden>
- Date: Tue, 12 Jul 2011 11:37:24 -0500
Hey Emmanuel,
On Jul 12, 2011, at 07:29, Emmanuel LEVY wrote: I think it's not Chrome, it's _javascript_. Only functions can return values, not the "out-of-any-handler" program. Check ECMA's specs (I didn't).
Since this works in Safari it's not unreasonable to expect it to work in Chrome.
tell application "Safari" tell front document set tabURL to do _javascript_ "document.URL" end tell end tell
Pulling usable information out of arrays and such is a bit more complex of course. That's why Smile, the groundbreaking - yet, free! - _javascript_-Applescript bridge, proposes in its dictionary "callJavaScriptFunction" in addition to the usual "callJavaScript".
That's good to know. Thanks for bringing it to our attention.
-- Best Regards, Chris
|
_______________________________________________
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