Page 1 of 1

copy and paste text from a field in a LC mobile app? - Solved

Posted: Tue Feb 07, 2023 9:51 pm
by DR White
How can I copy and paste text from a field in a LC mobile app to another app on my phone, like a text editor or google search engine?

Thanks,

David

Re: copy and paste text from a field in a LC mobile app?

Posted: Tue Feb 07, 2023 11:40 pm
by Klaus
Hi David,

native controls support this out of the box, I think.
For Android just use the "Android Native Field" widget and on iOS use:

Code: Select all

mobilecontrolcreate "input", "jeeehaw"
The latter wll also work on Android.

Best

Klaus

Re: copy and paste text from a field in a LC mobile app?

Posted: Wed Feb 08, 2023 12:19 am
by DR White
Klauss,

I will be trying that in a couple of days. I need to renew my Apple profile to be able to test app on phone.

Thanks

David

Re: copy and paste text from a field in a LC mobile app?

Posted: Wed Feb 08, 2023 11:42 am
by Klaus
Sorry, forgot an important information: Your USER has to copy the text manually!
There is no way currently to do this by script.

Re: copy and paste text from a field in a LC mobile app?

Posted: Thu Feb 09, 2023 2:24 pm
by DR White
Klauss,

I got my app running on my Android tablet and works great, but I cannot copy the text from fld "myFirstInputField" using code:

put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"

But that is OK the Android Widget works great! :D

Thanks,

David

Re: copy and paste text from a field in a LC mobile app? - Solved

Posted: Thu Feb 09, 2023 5:14 pm
by DR White
Klauss,

Works great, except for one thing.

I cannot put put text from a variable into the widget.
I tried :
put Test_4 into text of widget "Android Native Field_1" - Did Not work
put Test_4 into widget "Android Native Field_1" - Did Not work

I am not familiar with using widgets.

I went to the dictionary, but did not find much info there.

What is the proper format?

Thanks,

David

Re: copy and paste text from a field in a LC mobile app? - Solved

Posted: Thu Feb 09, 2023 5:44 pm
by Klaus
"the text..." is a property not a container, so this will do:

Code: Select all

set the text of widget "Android Native Field_1" to Test_4

Re: copy and paste text from a field in a LC mobile app? - Solved

Posted: Thu Feb 09, 2023 5:57 pm
by DR White
That works beautifully!! :D :D

I thought about trying that, but some reason I convinced myself it would not work.

Thank you so much!!

David