intent - selected text

RSF

Well-known member
The "extra" data fields show up in the receiving app as name/value pairs. Depending on the receiving app, you'll probably access them slightly differently. For example, MacroDroid and Tasker both populate local variables, with the names being the first element of each "extra" pair, and the value being the 2nd element (where you have the question marks). Androi apps written from scratch access the information via function calls like getCharSequenceExtra()...
In your example, you'd probably want to use a shorter string for the extra1 name, and put whatever value you want to pass to the receiving application on that 2nd row.
 

Theo

New member
I've no influence to the receiving app (@Voice Aloud Reader).
I just figured out that with these parameters the 2nd element gets passed to the receiver.
But I want to pass the whole text that I selected before?
 

RSF

Well-known member
If by "whole text that I selected before", you mean the current contents of the clipboard -- i.e., if you've selected text and put it into the clipboard -- then:
1) Tap the blue rectangle with the three dots inside, to the right of where you have the ?????
2) Find "Clipboard text" in the list that displays
3) Click OK
4) (Also, make sure you delete the ?????? before saving the send-intent action)

If you mean something other than the clipboard contents, can you describe that a bit more?
 

Theo

New member
No - I don't mean the clipboard text.

I've an app where I long press and then I select "select all" (I do this with "UI Interaction - long click[x, y]. Pause. UI Interaction - click[xx,yy])
Afterwards - instead of "share" (on this pop-up-menu) - I want to send that "selected text" to the other app.
(Because sometimes that pop-up-menu disappears. Otherwise I would have done this by another UI Interaction.)
 

RSF

Well-known member
Ah. It might be possible to get the selected text into the clipboard, via either a MacroDroid UI Interaction "Copy" action, or via the Share menu in the other app -- most of the "Share" popups on my phone seem to include a copy-to-clipboard action. Once the text is in the clipboard, then MacroDroid should be able to send it to the voice app via the intent.
Using UI Interactions can be tricky, of course. Adding delays in between steps seems to help, as you've done.
An alternative, in case that approach doesn't work reliably, would be to use the AutoInput plug-in in MacroDroid to read the contents of the source app. The MacroDroid developer recently enhanced its integration with AutoInput to get the entire contents of another app's screen a variable. But then you have to parse through the whole thing looking for the portion you want... Hopefully the clipboard scheme will work for you.
 

Theo

New member
Thanks for your inputs.
Well - the strange thing is that this popup menu with "Copy Share Select all" sometimes disappears!
(I thought this would be better with Android 12 - but it's not.)
I've no idea why ...
Well - I guess I've to search for another solution - maybe AutoInput ...
 
Top