Page 1 of 1

copying text from safari & pasting it into a LC fld

Posted: Sat Jun 29, 2013 5:26 pm
by Coffee1633
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

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

Posted: Sun Jun 30, 2013 9:43 pm
by monte
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

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

Posted: Wed Nov 01, 2023 2:06 pm
by TorstenHolmer
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

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

Posted: Wed Nov 01, 2023 4:08 pm
by Klaus
Hi Torsten,

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


Best

Klaus

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

Posted: Wed Nov 01, 2023 4:54 pm
by Klaus
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?

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

Posted: Wed Nov 01, 2023 6:55 pm
by stam
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"

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

Posted: Wed Nov 01, 2023 7:07 pm
by Klaus
Sheeesh... :-D

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

Posted: Wed Nov 01, 2023 8:32 pm
by stam
Always looking to make code as short as possible ;)

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

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