Find my tablet - help?

Post your questions and help other users.

Moderator: Martin

Post Reply
evebrea
Posts: 116
Joined: 12 Aug 2013 15:28

Find my tablet - help?

Post by evebrea » 12 Aug 2013 15:34

I took apart the flow "read notifications" that reads off google notifications.. and i'm trying to change it into "find my tablet", where if the notification says "findnexus" (it's a nexus 7) it will start playing a loud sound, and possibly loop the sound until i do something to stop it. (tap a notification?) problem is i'm not all that big on scripting info. I imagine it's going to need at least one use of if() but beyond that, i'm not sure. I tried "if(notification_text == "findnexus") then" and for the next step in the flow put "play sound : soundhere" but nothing happened at all. In fact it threw an error. so i'm obviously doing something wrong. Could someone with more knowledge in this help me?

evebrea
Posts: 116
Joined: 12 Aug 2013 15:28

Re: Find my tablet - help?

Post by evebrea » 12 Aug 2013 20:14

Okay, so this is what i came up with:

script :

if(notification_text == "findnexus" )
{playsound("sdcard/notifications/core meltdown.mp3");
loopsound("sdcard/notifications/core meltdown.mp3") }

It's not failing with an error anymore, so apparently findnexus is getting seen. However it's not playing the sound, it just moves to the next step in the flow and initiates another sound (the next flow step)

I was taking playsound and loopsound from Secondlife's scripting method, "LSL" which uses if()s, and the like. Maybe i pointed it to the wrong directory?

How i figured this out : my knowledge of LSL scripting.

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

Re: Find my tablet - help?

Post by Martin » 13 Aug 2013 17:05

Hi,

Automagic does not allow to execute arbitrary actions like playing a sound in an action Script. The action Script is mainly designed to modify variables, create lists, modify global variables etc.
Please also see the help page of action Script for a list of all supported functions ([?]-button on the right side of the action type when editing an action).

I would start with a flow that has about the following structure:
-trigger Notification on Statusbar Displayed: * (* to check notifications of all apps or use the package name to restrict to a specific app like gmail)
-condition Expression: title=="findnexus"
-->true: -action Sound

The title of the notification has to exactly match the text findnexus.
You can also use a less restrictive check to trigger on all notifications containing the text findnexus
-condition Expression: indexOf(title, "findnexus")!=-1

You can extend the flow to play the sound in a loop by connecting the action Sound with an action Sleep: 10s and then by connecting back to the action Sound. You can stop the flow either manually within Automagic (Menu->Stop Flow) or with a second flow:
-trigger Notification on Statusbar Selected
-action Stop Flow: <name of the first flow>

Regards,
Martin

evebrea
Posts: 116
Joined: 12 Aug 2013 15:28

Re: Find my tablet - help?

Post by evebrea » 14 Aug 2013 01:52

Thanks for the assistance martin, you helped me clean things up a little bit. As for the sound, i just used audacity and looped it to a 3 minute sound. If i can't find my tablet in 3 minutes, i'll try again.

for anyone curious, how i'm getting the "findnexus" command is with one of the several free texting programs. As long as i have data of some kind, and it has notifications for new messages, i'm golden.

Part of my reasoning for this is the new google toy on their site didn't work so well for me. For one, as a tablet, there is no "ring", so i couldn't make it ring, and the location reporting took a bit to get going.

I've managed to cobble together this. : (image)
Image

What i think this is doing is playing the sound, then activating GPS with a 30 second timeout. If it times out, it triggers exception (is the location empty? if true, switch to passive location if false, email location!). If it doesn't time out, it goes and emails the location. Each method after it does the same, tries to find location, if it times out it moves on, checking if it got location data first. If it did, it switches over to email, if not, we continue on. Looping back to GPS once all three have been tried.

If anyone knows a way to clean this up more, let me know.

I'd like to possibly make it so turning off the sound INITIATES the gps sweep, or.. if it asks for a password and doesn't get it, it initiates the sweep.. or even after 60 seconds, it locks down the tablet with a passcode (is it possible to set security to passcode, and SET the passcode, via automagic? ) so that basically if someone ELSE picks up my tablet, or even takes it, i can lock them out, and have it's location sent to me so i can handle them myself.

Yeah, i'm going kinda over the top with security, i know. However, i paid $300 usd for this thing and i enjoy having it. I don't want anyone else to have any option of keeping it, even if it means i break down their door myself.
Last edited by evebrea on 15 Aug 2013 01:40, edited 1 time in total.

Post Reply