Making a Input Field and saving its variable.

2,980 views
Skip to first unread message

Nuno Mendes

unread,
Jun 20, 2012, 12:58:20 PM6/20/12
to tas...@googlegroups.com
Hey, I want to do a simple thing(I think), creating a Scene, where i wirte something on a text box, and pressing a button it saves the text on that TextBox to a variable.

My point is writing my "status" to that box, so if my friends or at work they send a SMS asking if im free or something, it auto-replies saying my status.

Anyone can tell me how to save the text on that box to a variable? Thanks!

easiuser

unread,
Jun 20, 2012, 2:37:33 PM6/20/12
to tas...@googlegroups.com
Use the Text Changed event for the TextEdit box and set a variable to %new_val.
 
Don't forget you can always press the little question mark when editing a scene element to get context sensitive help.

Nuno Mendes

unread,
Jun 20, 2012, 3:06:59 PM6/20/12
to tas...@googlegroups.com
I don't see any help icon near it...

Also, that sets variable to: %element_TextEdit1 , not to the text inside it :(

Nuno Mendes

unread,
Jun 20, 2012, 4:25:49 PM6/20/12
to tas...@googlegroups.com
So many pro programmers out there and noone can answer this simple question?:) (for you guys its simple though) :p

easiuser

unread,
Jun 20, 2012, 4:36:50 PM6/20/12
to tas...@googlegroups.com
OK.  Lets back up a bit.  If your in the scene editor (where you created the TextEdit box to begin with), tap the TextEdit box.  That should bring up the editor (where the help button is).  You should have 3 tabs.  UI, Background & Text Changed.  Tap Text Changed tab.  Add a task (+ button) select Variable-Variable Set.  In the Name field put your variable (make it global with a Capital Letter so it is available to other tasks, ie %SMS_REPLY_TEXT).  In the To field put %new_val.
 
BTW if you have standard replies, you may want to check out the menu element to select "sleeping", "at the movies", or whatever and change the reply accordingly and still have the textedit for something custom.  I do this with my SMS reply dialog and one of the options is to dictate a response in case I am driving.

Nuno Mendes

unread,
Jun 20, 2012, 4:45:23 PM6/20/12
to tas...@googlegroups.com
Can you provide me your scene ? Mines kinda ugly :P I'll try now what you said once more, and reply in 1minute

Nuno Mendes

unread,
Jun 20, 2012, 4:49:45 PM6/20/12
to tas...@googlegroups.com
:O wtf! This time it worked! xD

Can you provide me your scene? And what type of scene do you create and what task u create to have it? If i wanted a popup for example i had do add elemnts like text to it, so it could acept it o.o

Nuno Mendes

unread,
Jun 20, 2012, 4:54:12 PM6/20/12
to tas...@googlegroups.com
Another question, how u make the Button OK, to close the scene?

easiuser

unread,
Jun 20, 2012, 5:21:55 PM6/20/12
to tas...@googlegroups.com
My scenes are not all that fancy.  You can check out this thread for better examples and what people are doing with them. https://groups.google.com/forum/?fromgroups#!topic/tasker/39V1e6NePKU
 
To add a button tap the + sign while in the editor.  Tap the "teddy bear" to resize or move the elements around.  Tap on the button and then you can set the tap and long tap actions.  Add the task Scene-Hide Scene to make it disappear.  In the UI tab you can change the color, font, etc.
 
I use scenes to:
-Reply to SMS
-Dialog Yes/No for use in car (ie really big buttons)
-Display system information
-Create my own control panel for volume settings, network, etc.
 
My scenes are pretty well integrated into my other tasks but I will see if there is something generic I could post for you.

Cptnodegard

unread,
Jun 20, 2012, 5:36:01 PM6/20/12
to tas...@googlegroups.com
I use a text box in a scene to save URls into a text file. Since I don't want it to save to the text file every time a letter is entered into the text box I use a "Save" button on the side of it to transfer from a variable to the text file. 

Nuno Mendes

unread,
Jun 20, 2012, 5:53:46 PM6/20/12
to tas...@googlegroups.com
Dropbox error :D

@easiuser: Thx alot for all the help:) Btw, why not scene destroy(I got it working now too), and the hide won't just keep it in memory?

easiuser

unread,
Jun 20, 2012, 7:43:36 PM6/20/12
to tas...@googlegroups.com
Thought about saying that but at our point in the conversation I didn't want to scare you thinking you would have to recreate it with the editor. :-).  Destroy works to but sometimes I just use the element contents to save some data instead of creating a separate variable.  If destroyed the values are gone.  Just depends on whether you just need to hide it for a few steps.  Glad you got it working.
Reply all
Reply to author
Forward
0 new messages