Page 1 of 3

Dropbox Help

Posted: Mon Jan 25, 2016 12:19 am
by Jamie37
Hello,

Im currently undertaking a college project and I need to do something but have no idea how to and hopefully somebody can help.

What I need to do it have input field on a stack in livecode (For example name, date etc.) and then when a button is pressed, for livecode to create a text file and upload it to dropbox. Im not sure if this is possible and if it is, I really need some help.

Many Thanks
Jamie

Re: Dropbox Help

Posted: Mon Jan 25, 2016 7:31 am
by Simon
Hi Jamie,
What research have you done on Dropbox's API?

Simon

Re: Dropbox Help

Posted: Mon Jan 25, 2016 8:28 am
by Thierry
Jamie37 wrote: .... upload it to dropbox.....
Hi Jamie,
This might give you some useful information:

http://forums.livecode.com/phpBB2/viewt ... =4&t=12549

Good luck,

Thierry

Re: Dropbox Help

Posted: Wed Jan 27, 2016 1:03 am
by Jamie37
Hi,

Thank you both for your suggestions. I have had a play about but wouldn't know where to start. I ideally want it as simple as possible. Thierry, thank you for your link. I have looked at this previously but to honest, don't have a huge understanding. Like I mentioned, I do not really need it too complicated (Unless it is :P )

Again, thank you for your suggestions

Thanks
Jamie

Re: Dropbox Help

Posted: Thu Feb 25, 2016 2:53 pm
by gmccarthy

Re: Dropbox Help

Posted: Fri Mar 04, 2016 11:50 pm
by Jamie37
Thanks for the reply and the great example stack!

However, Ill be honest, i'm really struggling to understand how it works and cannot actually get it to work. I just want to write and read files and would rather leave the other stuff if possible. Sorry to be so un knowledgeable but this is a vital part of the project so need to get it working and to a point where I understand it.

Thanks
Jamie

Re: Dropbox Help

Posted: Sat Mar 05, 2016 12:02 am
by gmccarthy
In my stack click on the top left check box to show the steps to get dropbox setup for use.
Then, in the top right there are arrow buttons to go to the next cards that demonstrate copying files to and from dropbox.

Re: Dropbox Help

Posted: Sat Mar 05, 2016 5:08 pm
by Jamie37
Ok thanks for that. I am using the library from this thread: http://forums.livecode.com/phpBB2/viewt ... =4&t=12549

It work fine and i can log in and so on. The problem is that I do not want to log in every single time I launch the app and for it to log in automatically which I cannot work out how to do.

Thanks
Jamie

Re: Dropbox Help

Posted: Sat Mar 05, 2016 9:40 pm
by gmccarthy
My library in this thread uses the latest dropbox library: version 2.
If you set up an app in dropbox and generate the code on the dropbox site as per the instructions in my stack and paste it in somewhere in your stack, you no longer need enter passwords, login etc. There is a similar technique for the library your are using, but you will have to ask someone else for that.

Re: Dropbox Help

Posted: Mon Mar 07, 2016 7:24 pm
by Jamie37
Hi gmccarthy,

Thank you so much for your help! I now have a working dropbox API thanks to you.

Thanks
Jamie

Re: Dropbox Help

Posted: Mon Mar 14, 2016 10:52 pm
by Jamie37
Hi gmccarthy,

Sorry to bring up an old topic. I have a new question though. The file list folder obviously list the file names within a certain folder. What I need in my app is to have the file listed in a text field or just on a card (Either would do) and then for these file names to be clickable. Once one of them is clicked I would like it to go to a new card and fill some fields with the information from the file selected.

I am able to fill fields from a text file that is permanently written into the code but would have no idea how to do the above. If you or anybody else could help, it would be great and a massive help.

Thanks
Jamie

Re: Dropbox Help

Posted: Tue Mar 15, 2016 6:52 am
by gmccarthy
Are you referring to files on your hard drive or files in a dropbox?

Re: Dropbox Help

Posted: Tue Mar 15, 2016 12:23 pm
by Jamie37
Hello,

Sorry for not clarifying. They are from Dropbox.

Jamie

Re: Dropbox Help

Posted: Tue Mar 15, 2016 12:40 pm
by gmccarthy
Set the field as a list field: check Autohilite and listbehaviour in the property inspector.
The mousedown handler needs to get the hilitedtext when clicked.
You need to use Files-download from the dropbox library to get the text of the file from dropbox.

Re: Dropbox Help

Posted: Tue Mar 15, 2016 1:39 pm
by Jamie37
Ok, I have managed to do what you have suggested but the problem is. How do I put the "Header_files-download" fld into code and have it use a variable as the path. I have put the hilitedtext of the list field into a global variable "gSelectedFile" and would need to put that as the path i'm guessing?

Jamie