Exporting text from LiveCode in iOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mismel8
Posts: 11
Joined: Tue May 26, 2020 2:18 am

Exporting text from LiveCode in iOS

Post by mismel8 » Wed May 27, 2020 9:46 pm

Hi everyone. I am new to iOS development, and am trying to figure out the best way to export text from Livecode. I learned on the forums that automatically copying to the clipboard is not an option in iOS, so I'm looking for a solution.

Here is what I need to do:
A student completes a task on their iPad, and my program creates a text-based report that the student needs to get to me anonymously (I am doing research with students, so it needs to be anonymous, hence email won't work). My plan was to create a button to "Share Data" which would then copy the text and send students to a web form where they would paste and submit their data.

I read through the LiveCode documentation and I have no understanding of Native Fields, but that seems to be the only way to copy and paste in iOS (and it seems that I can't copy the text automatically, so it's not ideal). Before trying to learn how to use a native field, I figured I would ask here 1) whether this would allow me to at least have the students select all, then copy the text and 2) whether this is the best way to do what I need (my web form can also accept file uploads, if that matters).

Thanks!
Last edited by mismel8 on Thu May 28, 2020 6:13 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Exporting text from LiveCode

Post by richmond62 » Thu May 28, 2020 9:43 am

I'm unclear if you wish to export a text document, or copy text from a field to paste elsewhere.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Exporting text from LiveCode

Post by SparkOut » Thu May 28, 2020 10:11 am

LiveCode can take the text, confirm it is all correctly completed, convert it to a format for submission, encrypt it, along with some markers to ensure it is a genuine submission, and POST it to a url for receipt, sanitisation, verification and recording on your server.
No clipboard required. No swapping to another application.
So, would you be in a position to write a server script to receive a POST of data and process it? Or are you limited to upload of a file because of server configuration restrictions? Where do you see needing most help?

mismel8
Posts: 11
Joined: Tue May 26, 2020 2:18 am

Re: Exporting text from LiveCode

Post by mismel8 » Thu May 28, 2020 4:23 pm

I don't have access to a server, so I am not sure if that option would work (something like that would be great if it would). I only have access to online survey forms (Qualtrics and Microsoft Forms), so that's where I was planning to have them paste their data into a text box and then submit. I am guessing that wouldn't cooperate with POST.

The only option I can figure out is to display the data in a Native Field, have the student select and copy the data, open the link to my survey, paste the data into the survey, and click submit. Obviously that is cumbersome, but given the limitations I am working with, maybe the only option.

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Exporting text from LiveCode

Post by mrcoollion » Thu May 28, 2020 5:48 pm

Although I would not prefer this method if it is the only option you have got you do not need the student to copy the data from a field. You can use the clipboard functions from LiveCode to do this.
see http://lessons.livecode.com/m/2592/l/12 ... -clipboard

Regards,

Paul

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

Re: Exporting text from LiveCode

Post by Klaus » Thu May 28, 2020 6:04 pm

Hi Paul,

no clipboard related stuff available on the mobile platform! :?


Best

Klaus

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Exporting text from LiveCode

Post by SparkOut » Thu May 28, 2020 6:17 pm

I guess it might be possible to get LiveCode to Post data to a Microsoft Form, but I don't have any experience with the mechanics of that.
Is MS Forms a suggested interface because of the post receipt processing/ aggregation/ reporting that's being done? Or just because it can be switched on easily on your organisation's server?
Would you be able to work with the data format if you got a server configured to handle data posted that way? What about the implications of using an external server for that? (There are recent discussions here about very cheap hosting on LiveCode-ready servers that you could post to, receive and process submissions and then collect the aggregate data from.)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Exporting text from LiveCode in iOS

Post by richmond62 » Thu May 28, 2020 7:06 pm

How about exporting the data as a text file and then posting that to you, where you can then do whatever you like
with the text file?

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Exporting text from LiveCode in iOS

Post by jiml » Thu May 28, 2020 7:57 pm

If you have the commercial version of LC, couldn't your app use tsNet to send an email from your own SMTP account to your own account?

http://lessons.livecode.com/m/4071/l/68 ... t-external

Jim Lambert

mismel8
Posts: 11
Joined: Tue May 26, 2020 2:18 am

Re: Exporting text from LiveCode in iOS

Post by mismel8 » Fri May 29, 2020 1:50 am

Thanks for your suggestions, everyone. I have the free version of Livecode. We use Microsoft Forms because my organization has Office 365 and it includes that (it's basically the same as Google Forms). I don't have any funding for this project (and likely won't have any in the near future due to Covid-19 related budget restrictions), but it's good to know that that may be an option in the future. Perhaps if I run a pilot version of this (using the copy/paste method) and things turn out well, I can use an external server and do it that way in the future.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Exporting text from LiveCode in iOS

Post by SparkOut » Fri May 29, 2020 3:02 am

https://support.microsoft.com/en-gb/off ... dee909e845

The above link shows some suggestions how to share a form with users, and one of the options is to copy the source code of a form to embed on a web page or blog. It would be very interesting to see the code generated to be embedded. It could conceivably be something that could be wrapped in a LiveCode app. Or ...

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm
Location: Fort Saskatchewan, AB Canada

Re: Exporting text from LiveCode in iOS

Post by kdjanz » Fri May 29, 2020 3:24 am

Another idea worth throwing out there is the use of Dropbox. If you set up a Dropbox for the project with a unique email and login, you could then have your LiveCode app save a text file of results (with a unique name on each device so that you don't get duplicates) and then use the code to upload that text file to Dropbox for analysis later. You could display the text file to the student, then ask permission to upload anonymously - just so that the permissions etc are very transparent. LiveCode works well with Dropbox so you could probably get help here on the forum to make the code happen.

Kelly

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Exporting text from LiveCode in iOS

Post by Mikey » Fri May 29, 2020 2:42 pm

we use dropbox to do exactly this, and we go both directions - to the devices and from the devices.

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Exporting text from LiveCode

Post by mrcoollion » Fri May 29, 2020 2:56 pm

Klaus wrote:
Thu May 28, 2020 6:04 pm
Hi Paul,

no clipboard related stuff available on the mobile platform! :?


Best

Klaus
Oops.. missed the mobile platform part.... :oops:

Did some digging and it seems that other than Copy/Paste you cannot import data into MS Forms..
https://techcommunity.microsoft.com/t5/ ... -p/1220821

Paul

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

Re: Exporting text from LiveCode in iOS

Post by Klaus » Fri May 29, 2020 3:22 pm

mrcoollion wrote:
Fri May 29, 2020 2:56 pm
Oops.. missed the mobile platform part.... :oops:
Not that we are here in the iOS forum... :-D

Post Reply

Return to “iOS Deployment”