Problema with UI Events

Post your questions and help other users.

Moderator: Martin

Post Reply
mathieson
Posts: 51
Joined: 13 Aug 2013 18:16

Problema with UI Events

Post by mathieson » 15 Mar 2016 03:50

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!

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Problema with UI Events

Post by MURTUMA » 15 Mar 2016 07:55

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.

mathieson
Posts: 51
Joined: 13 Aug 2013 18:16

Re: Problema with UI Events

Post by mathieson » 15 Mar 2016 19:07

I tried the above, trigger ui event. Seems to have no results at all. I'm on a Nexus 6P.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Problema with UI Events

Post by Martin » 15 Mar 2016 20:13

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

Post Reply