Page 1 of 1

Problema with UI Events

Posted: 15 Mar 2016 03:50
by mathieson
Hello,

In another thread I saw the following:

Trigger UI Event

A Google Now voice search was executed. The search term can be accessed in the flow in variable text.
Event Type: Text selection changed
Package Name: com.google.android.googlequicksearchbox
Text: leave empty

Should this work? I can't seem to get it to work at all. Thanks!

Re: Problema with UI Events

Posted: 15 Mar 2016 07:55
by MURTUMA
The topic, you found it from hasn't been updated in a few years. Maybe there's something changed. What have you tried so far?

I would try myself, but my old brick phone doesn't have Google Now feature.

Re: Problema with UI Events

Posted: 15 Mar 2016 19:07
by mathieson
I tried the above, trigger ui event. Seems to have no results at all. I'm on a Nexus 6P.

Re: Problema with UI Events

Posted: 15 Mar 2016 20:13
by Martin
Hi,

Google probably changed the implementation of Google Now so the old method does not work anymore. You could try to use a trigger Activity Started to detect when the search is executed and then grab the text from the search field.
Something like this could work:
-trigger Activity Started package: com.google.android.googlequicksearchbox, class: com.google.android.apps.gsa.legacyui.VelvetActivity
-action Control UI with script sleep(2000);text=getText(545, 293);

Timing and coordinates are probably different on your device. The plugin AutoVoice supported Google Now in the past, maybe they found a way to reliably detect the spoken text on newer versions of Google Now.

Regards,
Martin