This task will back out of the currently running app.
Very useful in situations where you open an app, automate it with AutoInput and want to back out of it when you're finished so you end up where you started.
It will check the current app then press back as long as the current app is still the same.
Here is the Task description (you can also download the task's xml so you can directly import it):
Exit App (419)
A1: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A2: AutoInput UI Query [ Configuration: Package:com.joaomgcd.autoinput Name:AutoInput UI Query Timeout (Seconds):20 ]
A3: Variable Set [ Name:%apptoexit To:%aiapp Do Maths:Off Append:Off ]
<Go back>
A4: AutoInput Global Action [ Configuration:Action: Back Package:com.joaomgcd.autoinput Name:AutoInput Global Action Timeout (Seconds):20 ]
A5: Flash [ Text:Exiting %apptoexit Long:Off ]
A6: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A7: AutoInput UI Query [ Configuration: Package:com.joaomgcd.autoinput Name:AutoInput UI Query Timeout (Seconds):20 ]
A8: If [ %aiapp eq %apptoexit ]
A9: Goto [ Type:Action Label Number:1 Label:Go back ]
A10: Else
A11: Flash [ Text:Exited %apptoexit Long:Off ]
A12: End If