Re: Using tasker to read a text file and store a string of text to clipboard

4,699 views
Skip to first unread message

Matt R

unread,
Oct 12, 2012, 11:39:00 AM10/12/12
to tas...@googlegroups.com
A straightforward way to do it is to have each of the three buttons do the File -> Read Line action and hardcode the line number you're reading for each button (put 1 in the Line box for button 1, 2 for button 2, etc.).  The To Var box is where you put the name of the variable you want the text stored (e.g. %Password).  Then another action to Misc -> Set Clipboard.  This could be done all in one action if you stored the text in a Tasker array instead of a text file.  You can read about arrays in the userguide (menu button -> info -> userguide or online at http://tasker.dinglisch.net/userguide/en ).
 
Matt

Pent

unread,
Oct 12, 2012, 11:39:12 AM10/12/12
to Tasker
File / Read File FILEPATH -> %filecontents
Set Clipboard, %filecontents

Pent

Chase Donald

unread,
Oct 12, 2012, 1:20:56 PM10/12/12
to tas...@googlegroups.com
I really have no clue how, but i figured it out... maybe you guys could help me clean it up.
for a button under tap controls these are the tasks i used:
1. Read File- tile path to specified text
       To Var: %PASS1
2. Set Clipboard
       Text: %PASS1
and that loaded the text in the file to the clipboard.

my question is, do i even need those tags, and what are they doing.
The way it is i hafto have seperate text files for each string of text. Ideally i would have all the strings in one file and tasker would know only to read the line of text assigned to each button
ie: %PASS1, %PASS2, %PASS3.

what am i missing to do that?
 

On Friday, October 12, 2012 10:10:14 AM UTC-4, Chase Donald wrote:
I would like to setup a scene that has a grid of buttons. Each button reads a certain text file stored on the phone and copies a string of text. the example would be:

Button1 (CopiesText1 to clipboard)
Button2 (CopiesText2 to clipboard)
Button3 (CopiesText3 to clipboard)

Text File Is set like:

(line1) Text1 Password1
(line2) Text2 Password2
(line3) Text3 Password3

So hitting button one would look at the text file for whatever is on the line with Text1. It would then store whatever text was there (in this case password1) in the clipboard for pasting.

Is this possible? I don't really understand the variables thing but this seems like simple scripting

Chase Donald

unread,
Oct 12, 2012, 1:22:39 PM10/12/12
to tas...@googlegroups.com
The user needs to be able to change the text. this will be packaged up as a tasker app.. with an array would i be able to edit the "text" from within the app via an in app button?

Chase Donald

unread,
Oct 12, 2012, 2:51:21 PM10/12/12
to tas...@googlegroups.com
Oops. nevermind. i figured it out with read line. I thought i had to have something in the text file defining the line.. not the case.
Reply all
Reply to author
Forward
0 new messages