copying text from safari & pasting it into a LC fld

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

copying text from safari & pasting it into a LC fld

Post by Coffee1633 » Sat Jun 29, 2013 5:26 pm

I would like to get text from the web and paste it into a livecode field. I read somewhere in the forums that if you implement your own browser window from within your LC app you can surf but not copy and paste data. Is that true?

Under the assumption that it is, I am launching Safari from the app, surf around and then copy some text from Safari to the clipboard.
However, when I get back to my app, I am unable to access the the Safari data from the clipboard.

Question 1: is it possible to copy from a LC native browser window and paste to a LC field?
Question 2: If not is it possible to copy text data from Safari and paste it into a LC field?

coffee16

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: copying text from safari & pasting it into a LC fld

Post by monte » Sun Jun 30, 2013 9:43 pm

I don't think there's clipboard support in the engine on iOS. You could probably use a native field with the built in cut, copy, paste menu when you long press... Alternatively it would be a fairly easy external to write. Trevor Devore has one that sets the clipboard... you could contribute a command that gets it:
https://github.com/trevordevore/iosclipboard

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

TorstenHolmer
Posts: 57
Joined: Mon Oct 28, 2013 1:23 pm
Location: Dresden, Germany

Re: copying text from safari & pasting it into a LC fld

Post by TorstenHolmer » Wed Nov 01, 2023 2:06 pm

I am looking for a way to put text from a livecode field into the clipboard of an iOS-Device. The plugin from Trevor seems to do this, but I cannot see how to use the plugin in my livecode app because there is no description / documentation for it.

Can somebody explain me how to integrate the plugin into a iOS-Livecode app?

Kind regards,
Torsten

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

Re: copying text from safari & pasting it into a LC fld

Post by Klaus » Wed Nov 01, 2023 4:08 pm

Hi Torsten,

maybe just add the external via "Add files" in the "Standalone Application Setting"?
Just guessing...


Best

Klaus

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

Re: copying text from safari & pasting it into a LC fld

Post by Klaus » Wed Nov 01, 2023 4:54 pm

And the dictionary states that "copy" is supported on mobile.
So may be just try:

Code: Select all

...
select text of fld "your field here"
copy
...
and see if you can paste it somewhere else?

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: copying text from safari & pasting it into a LC fld

Post by stam » Wed Nov 01, 2023 6:55 pm

That's a good suggestion Klaus! As you say, this should work on both iOS and Android...
Can be done with 1 line I think:

Code: Select all

copy word 1 to -1 of field "myField"

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

Re: copying text from safari & pasting it into a LC fld

Post by Klaus » Wed Nov 01, 2023 7:07 pm

Sheeesh... :-D

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: copying text from safari & pasting it into a LC fld

Post by stam » Wed Nov 01, 2023 8:32 pm

Always looking to make code as short as possible ;)

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

Re: copying text from safari & pasting it into a LC fld

Post by Klaus » Wed Nov 01, 2023 9:00 pm

stam wrote:
Wed Nov 01, 2023 8:32 pm
Always looking to make code as short as possible ;)
Yep, just kidding, same here. :wink:

Post Reply

Return to “iOS Deployment”