paste into LC field from mobile browser

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Coffee1633
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 219
Joined: Mon Dec 05, 2011 5:35 pm
Location: Kanagawa, Japan

paste into LC field from mobile browser

Post by Coffee1633 » Mon Sep 02, 2013 1:23 pm

I think I asked this question before but maybe things have changed or there is a work around that I am not aware of.

I need to take the copied text from a mobile browser (MobGui browser control) and paste it into a LC field. Is this possible with code?
The user would choose some text from the web, copy it, then click a button on a tool bar at the bottom of the app and the text would get copied into a LC field for later use.
The clipboardData in the dictionary says no mobile OS available for this function.
Is there a way to get at copied text from a web page?

Coffee16

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: paste into LC field from mobile browser

Post by LCNeil » Wed Sep 04, 2013 9:32 am

Dear Coffee16,

It is currently not directly possible to do this because , as you have mentioned, clipBoard data is not yet supported on mobile.

However, there is an alternative method you could use. You could create a native mobile input field and paste any data copied from a native browsers into this. From here you could use the the following script to get the text of this native field and then place its content into a LiveCode field -

mobilecontrolGet(inputIDofyournativefield, "text") into field "data"

Kind Regards,

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
--

Coffee1633
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 219
Joined: Mon Dec 05, 2011 5:35 pm
Location: Kanagawa, Japan

Re: paste into LC field from mobile browser

Post by Coffee1633 » Fri Sep 06, 2013 1:03 am

Dear Neil
Thanks for the advice. I think I can patch something together with that work around.
But maybe a copyFromClipboard for native iOS controls could be added in the future. I know I would be ecstatic to have that function!

There is one other problem I encountered and it seems to be a MobGUI one. I tried replicating it from scratch but the only place it shows up is in the current build of my app.

And this is weird. When I put a multiline text Native control from MobGui onto card”read” then the button”back” stops working. If you remove the multiline text control from the “read” card then it works. Whaaaaat? This behavior only shows up in my current configuration. And only in the iOS simulator. Any ideas? There is also a scroller and a whole bunch of groups on the read card. Is one of the other MobGui controls catching the button press first? I can't figure it out.

The behavior only shows up in the iOS simulator. that is: when the MobGui Multiline text control is added to the "read" card, then the back button stops working. Delete the control and the navigation works. Huh?

I have already spent so many hours trying to figure this out but I am pulling what hair I have left out of my head and it hurts. I am attaching the stack. If you have time, maybe you can see something that I can’t.

kind regards,
Coffee16
Attachments
Reading Helper v26 browser function copy.livecode.zip
(211.62 KiB) Downloaded 99 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: paste into LC field from mobile browser

Post by Simon » Fri Sep 06, 2013 1:40 am

Hi Coffee16,
Do you delete the control before you attempt to leave the card?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Coffee1633
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 219
Joined: Mon Dec 05, 2011 5:35 pm
Location: Kanagawa, Japan

Re: paste into LC field from mobile browser

Post by Coffee1633 » Fri Sep 06, 2013 10:25 am

Auto destroy is off. Left the default settings for the multi line text as is.
I don't delete the control before leaving the card
Am I supposed to?

C

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: paste into LC field from mobile browser

Post by Simon » Fri Sep 06, 2013 8:35 pm

Ok Coffee1633,
After stripping everything out of your stack the error still occurred.
This is a mobGui problem.
If you remove that multi-line and just put in a single line on cd "read" then run it in the sim you will see because of the "slide right" that the field disappears as the slide happens. This is normal when using mobileControlCreate, you must mobileControlDelete on closeCard.

Good news is you can still add a native multi-line field you just have to build it yourself and not use mobGui.

Now why isn't it working? Not sure, but it's not always the case. From a new stack multi-line does work going from card to card. Maybe try the opensource mobgui then at least you can debug it because there is no password.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

EOTR
Posts: 49
Joined: Fri Aug 09, 2013 7:20 pm

Re: paste into LC field from mobile browser

Post by EOTR » Fri Sep 06, 2013 11:06 pm

Simon wrote:Maybe try the opensource mobgui...
There's an open source Mobgui? How do you get it?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: paste into LC field from mobile browser

Post by Simon » Fri Sep 06, 2013 11:18 pm

I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply

Return to “Summer School 2013”