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: Bruce Robertson <email@hidden>
- Date: Wed, 13 Jul 2011 14:17:41 -0700
There is no text field on the google page with an ID of "q".
The search field has a NAME of "q".
The script seems to work in the sense that it knows when the page is loaded.
But what exactly is supposed to happen with this script as originally written?
My impression is that it is supposed to display "loaded!" in the search field of the page.
Doesn't happen.
Bruce Robertson
On Jul 13, 2011, at 11:33 AM, julifos wrote:
> What if you use a "display dialog" instead of the callJavaScript? Maybe
> your Google config doesn't include a "q" textfield...
>
> This works for me in Smile 3.5.3 build 617:
>
>
>
> make new web window with properties ¬
> {path name:"http://www.google.com/", script:foo}
>
> script foo
> on pageloaded w
> display dialog "Loaded" with icon 1 callJavaScript w script ¬
> "document.getElementById('q').value='loaded!'"
> end pageloaded
> end script
>
>
>
> jj
>
>
> El 13/07/11 17:19, "Bruce Robertson" <email@hidden> escribió:
>
>> Doesn't seem to do anything.
>> (After fixing breaks caused by email).
>>
>> Bruce Robertson
>>
>> On Jul 13, 2011, at 12:42 AM, julifos wrote:
>>
>>> Like this (for future reference ;-):
>>> ########
>>> make new web window with properties {path name:"http://www.google.com/",
>>> script:foo}
>>> script foo
>>> on pageloaded w
>>> callJavaScript w script "document.getElementById('q').value='done
>>> loading!'"
>>> end pageloaded
>>> end script
>>> ########
>>> jj
>>> El 13/07/11 01:30, "Emmanuel LEVY" <email@hidden> escribió:
>>>> For those interested, Smile's web window receives a "pageloaded" event
>>>> when the page is safe.
>>>> Emmanuel
>>
>>
>
>
_______________________________________________
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