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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

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

Post by DR White » Tue Feb 07, 2023 9:51 pm

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
Last edited by DR White on Thu Feb 09, 2023 3:02 pm, edited 1 time in total.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Tue Feb 07, 2023 11:40 pm

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

DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

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

Post by DR White » Wed Feb 08, 2023 12:19 am

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

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Feb 08, 2023 11:42 am

Sorry, forgot an important information: Your USER has to copy the text manually!
There is no way currently to do this by script.

DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

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

Post by DR White » Thu Feb 09, 2023 2:24 pm

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

DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

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

Post by DR White » Thu Feb 09, 2023 5:14 pm

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

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Thu Feb 09, 2023 5:44 pm

"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

DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

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

Post by DR White » Thu Feb 09, 2023 5:57 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”