Touchless Hangouts

Learn how you can chat in hangouts without ever needing to touch your phone.

  1. joaomgcd

    STEP 1 - INTERCEPT NOTIFICATION


    • Create a new Profile
    • Use the Event->plugin->AutoNotification Intercept condition
    • In the AutoNotification settings, select the Hangouts app
    /!\ (missing from the video) Under "Action Type" choose "Created"
    (i) If you don't select this option the profile will trigger when you dismiss the notification too
    • Accept these settings and create a new Task
    (i) This profile will trigger any time the hangouts app creates a notification. That means that every time you receive a hangout from someone, this will trigger.


    STEP 2 - SET PROMPT


    • Insert a "Variable Set" action
    • Set the variable %prompt to 'Say "reply" or "dismiss".'
    (i) Because this prompt will be used in 2 places, we're setting it as a variable so it's easier to change if needed. It's always best to not write duplicate stuff in Task to make it easier to maintain :)


    STEP 3 - ANNOUNCE HANGOUT


    • Add a "Say" action
    • Set the text to "New hangout from %antitle. %prompt"
    (i) %antitle will be the name of the contact that sent the hangout


    STEP 4 - RECOGNIZE "REPLY" OR "DISMISS"


    • Add an "AutoVoice Recognize" action
    • In the "Prompt Text" field use the previously created %prompt variable
    • Check the "Hide Dialog" option.
    /!\ This option is used merely to make this more aesthetically pleasing. Because of a bug in Google's voice recognition software, this option will always use your default system language for voice recognition. If you want to use a different language, don't enable this option
    • Accept these settings and go back to the Task


    STEP 5 - IF REPLY


    (i) We're going to support 2 possible responses: "reply" or "dismiss". Let's build the "If"s that are needed to do this

    • Add an "If" action
    • Set the condition to "%avcomm matches reply"
    (i) Inside this "if" part will be what you do if you say "reply"


    STEP 6 - ELSE IF DISMISS


    • Add an "Else" action
    • Add an "if" condition inside this "Else" action
    • Set the condition to "%avcomm matches dismiss"
    (i) Inside this "Else" part will be what you do if you say "dissmiss"


    STEP 7 - END IF


    • Add an "End If" action
    (i) This simply closes the "If" so that everything after it is executed regardless


    STEP 8 - OPEN HANGOUT


    • Insert an "AutoNotification Actions" action right after the "If"
    • In the "Intercept Action ID" field write %antouchaction
    (i) %antouchaction is the action associated with touching the notification you intercepted. This will effectively simulate clicking on the hangouts notification.
    • Accept settings and go back to Tasker


    STEP 9 - SET PROMPT AGAIN


    • Add a "Variable Set" action
    • Change the %prompt variable value to "What do you want to reply"?


    STEP 10 - SAY PROMPT


    • Add a "Say" action
    • Set the text to %prompt


    STEP 11 - GET WHAT YOU WANT TO REPLY


    • Add an "AutoVoice Recognize" action
    • Once again set the "Prompt Text" field to %prompt and check the Hide Dialog option


    STEP 12 - SET REPLY TO CLIPBOARD


    • Add a "Set Clipboard" action
    • Set the "Text" field to %avcomm
    (i) This will set your Android device's clipboard to the voice command you say, so you can then paste that text with AutoInput.


    STEP 13 - PASTE CLIPBOARD


    • Add an "AutoInput Action" Tasker action
    • In the "Action" option, select "Paste"
    • In the "Field Type" option, select "Focus"
    (i) This will make AutoInput paste the text from your clipboard to the field that's currently in focus. Since you previously clicked the Hangouts notification with AutoNotification, the hangout conversation was opened and the text input field was automatically focused.


    STEP 14 - LOOK FOR THE SEND BUTTON


    • Add another "AutoInput Action" Tasker action
    • Select the "Easy Setup" option
    (i) You'll now need to open hangouts to find out what the send message button on it is. AutoInput will guide you through that.


    STEP 15 - FIND THE SEND BUTTON


    • Open a hangouts conversation
    • Write some text in the text field
    (i) You'll see that the button to send the message becomes available.
    • Pull down on the notification bar
    • Touch the "Add" button in the AutoInput notification
    • Touch the button to send the message in hangouts.
    (i) Your message will not be sent. The button will simply be detected by AutoInput
    • Click the Accept button in the AutoInput notification, go back to Tasker, select the "com.google.android.apps.hangouts:id/realtimechat_send_button", then the "Click" option, accept these settings and go back to the Task


    STEP 16 - SAY "REPONSE SENT"


    • Add a "Say" action
    • in the text write "Response Sent"


    STEP 17 - CANCEL HANGOUT IF "DISMISS" WAS SAID


    (i) This part of the task will cancel the hangouts notification

    • Add an "AutoNotification Cancel" action right after the "Else" action


    STEP 18 - FILL IN NOTIFICATION CANCELLING FIELDS


    • In the "Other Id" field write %anid
    • In the "Package" field write %anpackage
    • In the Tag field write %antag
    • Accept these settings and go back to the Task


    STEP 19 - SAY "DISMISSED"


    • Add a "Say" action after the "AutoNotification Cancel" action
    • Set the text to "Dismissed"
    • Accept these settings and go back to the task


    STEP 20 - SOME THINGS ARE NOT PROPERLY WORKING


    • Back out of Tasker so that everything is saved.
    /!\ If you now test the profile you'll notice a few things that could be better:
      • The initial "Say" doesn't say the actual text of the hangout
      • When you reply, the hangout is left open. It would be better if you would end up where you started
      • The "dismiss" word might not be correctly recognized. It seems to recognize "business" instead, more often than not.
      • Let's fix these!


    STEP 21 - ADD HANGOUT TEXT TO SAY


    • Go back to the task
    • Edit the first "Say" action
    • Add the text "%antext." after the "New hangout from %antitle." text
    (i) This will make the announcer say what the hangout content actually is.


    STEP 22 - BUSINESS=DISMISS


    (i) Now we'll make sure that if "business" is recognized instead of "dismiss", that AutoVoice still recognizes it as "dismiss"

    • Edit the first "AutoVoice Recognize" action.
    • Select the "Matching Options" setting at the bottom
    • In the "Replacements" field at the bottom enter the text "business=dismiss".
    (i) This will make AutoVoice replace any instance of the text "business" with "dismiss" in the recognized voice command


    STEP 23 - PRESS BACK 1


    (i) Now, to take care of the fact that hangouts remains open after you reply, we're adding 2 "AutoInput Global Action" Back actions, so that Hangouts is automatically backed out of.

    • Add a new "AutoInput Global Action" Tasker action
    • Select the "Back" option
    • Go back to the Task


    STEP 24 - WAIT 1 SECOND


    • Add a 1 second "Wait" action
    (i) If you want to press back multiple times you'll always need to wait sometime between presses or it will be too quick for the Android system and the open app to acknowledge.


    STEP 25 - PRESS BACK 2


    • Add another "AutoInput Global Action" Back action


    STEP 26 - SAVE


    • Back out of Tasker so that your settings are saved
    (i) You are now ready to use it! Try out saying "replay" or "dismiss" when you receive a hangout!
    (i)You can apply the same kind of Task to any instant messaging app, like Facebook messenger, Whatsapp, etc. As long as you can open the right conversation, paste the text and press the send button, you're golden :)

    lostmedic likes this.