Speaking text from a file

Here you are welcome to discuss items of general interest related to Push2Run
Post Reply
jobolobo637
Posts: 2
Joined: Sat Jul 10, 2021 4:27 am

Speaking text from a file

Post by jobolobo637 »

Hello, Sorry if this is posted in the wrong place.
I have a question about automation of google assistant with push2run.

I have created a tally counter of sorts using google assistant, push2run and google sheets.

My push2run tally counter is something like this:-

[Listen for] ~ Add 1 point for $
[Open] ~"Google sheets" (webpage for my specific sheet)
[Keys to send] ~{WAIT999}{WAIT999}{WAIT999}{WAIT999}{WAIT999}{DOWN}{ALT}{SHIFT}{I}{RELEASE}{WAIT500}{R}{WAIT999}{WAIT999}{ADD}{1}{ }${ENTER}{WAIT999}{WAIT999}{WAIT999}{WAIT999}{WAIT999}{ALT}{F4}
The first wait is for loading of the webpage and the document. Then the Down command moves past the headers set on the page. (Alt shift I) (wait) (r) is for the shortcut key to insert a row above so it always pushes old data down.(Add 1 $ Enter) is for the adding text to the cell, followed by another wait for saving and alt F4 to exit. This works flawlessly if the webpage is "not" open.

My question is... is possible to make my google assistant read a cell from my google sheets document or a text file on my computer?
I know there is a set command with your google assistant for timers where you can ask your google to set a 5min timer. You can further ask how much time is left on the timer. This is the type of thing I'd like to ask. "tell my computer to tell me the tally for ..."

Hope this makes sense, Thankyou in advance for your replies.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Speaking text from a file

Post by RobLatour »

With extra keystrokes you could probably do something like this if you wanted the text read aloud over your computer speakers:
https://www.gtricks.com/docs/2-ways-to- ... loud-text/

If you want the text read aloud on your google device it would be more complicated.

For this, you would have to find a way to save the number to a separate file (for example more keystrokes to open up a .txt file and paste into it), and then cast that file to your google device.

You can use another program I wrote called "cast" to do the casting part using the -text option:
https://rlatour.com/cast/
jobolobo637
Posts: 2
Joined: Sat Jul 10, 2021 4:27 am

Re: Speaking text from a file

Post by jobolobo637 »

Hey Rob,

Thanks for your reply. Your information and programs are valuable. Ill look into it tomorrow and let you know how I go with the "cast" software.

So far I installed and its just closing instantly as I "press enter to continue" or type any commands?

You have given me some great ideas.
Thankyou
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Speaking text from a file

Post by RobLatour »

Yes, that is by design. Cast is a Windows command line program, which means it can be run from the Windows command line or via a batch (.bat) or script file.

To run it from the command line, press the Windows and R keys at the same time. Then in the box that pops up enter
cmd

At the c: prompt enter:
cd \
cd "program files
cd cast
cast
<< the last command will list out the help for cast >>
for example you can type
cast -text "hello"

to run it in a batch file, create an empty file called test.bat, edit it with MS Notepad (not Word but Notepad), type into the first line
cast -text "hello"
and save the file.

Then double click on the file test.bat to run it.
Post Reply