Page 1 of 1

Automate selected text to goole translate. Possible?

Posted: 23 Feb 2014 14:22
by cadudesun
Hi,

Considering my need of word/small sentences translation, I use some apps (e.g. press, greader, or even internet browsers) in which I have to:
1- select text
2- click on share (and wait loading apps available to share!)
3- select "google translate" (then the text appears automatically translated, at least it!)

I was wondering if Automagic is able to shorten these steps, mainly the step 2. The idea would be:
1- select text
2- use any customizable automagic command
3- the selected text would go direct to "google translate"

Thanks for any advices!

Re: Automate selected text to goole translate. Possible?

Posted: 26 Feb 2014 17:57
by Martin
Hi,

You could use one flow to access the clipboard content whenever a new text is copied to the clipboard and use a second flow to start the translation.
This requires that the app containing the text to translate properly shows a Copy-command in the action bar.

Flow to copy the clipboard text to a global variable:
-trigger Clipboard Changed
-action Copy Text from Clipboard: to variable global_text

Flow to translate the text:
-trigger Notification on Statusbar Selected: Translate Globe
-action Start Activity: Translate with following settings:
Action: android.intent.action.SEND
Data Mime Type: text/plain
Explicit component: checked
Package Name: com.google.android.apps.translate
Extras: putString("android.intent.extra.TEXT", global_text);

The last action builds a share-intent that directly targets the Google Translate app. The intent contains an extra with the text to translate that's stored in global variable global_text.

The flows still require to copy the text to the clipboard, swipe down the notification drawer and to select the notification so I'm not sure if this is much of an improvement over the original procedure.

Regards,
Martin

Re: Automate selected text to goole translate. Possible?

Posted: 26 Feb 2014 18:12
by cadudesun
Thanks. Great to know more Automagic features!