Guillermo's Dropbox lib

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Guillermo's Dropbox lib

Post by Zood » Sat Jun 17, 2017 1:38 pm

Hello,

Whilst using Guillermo's Dropbox library i came upon a probem.
I have called this function:

Code: Select all

on SendToCloud
put url ("file:" & specialfolderpath("desktop") & "/test.csv") into myData
phx_DropboxWriteFile("dropbox","/test.csv","application/octet-stream",true,myData)
end SendToCloud
and another button to call this function:

Code: Select all

on mouseUp
SendToCloud
end mouseUp
I am getting an error: "Handler: Can't find handler" on line 2 of the "SendToCloud"-function.

any ideas on how to fix this?
the phx_dropboxReadFile-function works like a charm!

Thanks in advance,
Zood

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

Re: Guillermo's Dropbox lib

Post by Mikey » Sat Jun 17, 2017 2:17 pm

Zood,
A couple of things:
1) inheritance in LC - put the first handler in the card or stack script so the second will find it
2) Gugliermo has abandoned the phx_dropbox library. I have been maintaining it as needed. I have the latest version on my github repo, BUT
3) Dropbox has deprecated v1 of the API. It is scheduled to be turned off at the end of the month. You can get an extension if you ask, but it will be deactivated this year. I was trying to decide whether to fix phx_dropboxlib or not but for a variety of reasons I have decided not to, mainly because
4) LC now has its own built-in Dropbox library. It supports both synchronous and asynchronous calls. You can fetch it from the LC github repo or if you load 9.0dp7 it is included in there. I have found it to be pretty easy to use, so, rather than fixing phx_dropboxLib I'm moving to the LC lib.
5) Gerard also has a v2 library (that LC used as a starting point for their library), so you could also use that (but Monte did a lot of nice work with the LC lib, so I would recommend the LC version). I also have his library on my github account, if you wish to fetch it from there.

Email me off-list if you can't figure out how to fetch LC's v2 lib. You can use it with LC 8 or 9. I think maybe I'll fork LC's lib and put that on my github, too, for easy fetching.

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

Re: Guillermo's Dropbox lib

Post by Mikey » Sun Jun 18, 2017 4:49 am

OK, Zood, here are the repos:
1) LC's new dropbox library: https://github.com/macMikey/LCDropboxLibrary
2) Gerard's dropbox v2 library: https://github.com/macMikey/dropboxapi_v2
3) The current version of phx_dropboxlib: https://github.com/macMikey/phxDropboxLib

For documentation of LC's library, I would suggest downloading LC9 DP7 and opening the dictionary, then using the popup menu in the top-left to choose "dropbox". Gerard's library/stack might be helpful for playing with the new API, and trying things out, since LC"s library is based on (but the syntax is very different from) Gerard's library.

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Re: Guillermo's Dropbox lib

Post by Zood » Sun Jun 18, 2017 11:09 am

Hey Mikey,

thanks for the fast answer!
I did not know Guillermo's library was about to be discontinued, such a shame!
With a little practice, I hope LC's version will do the same trick.
Was playing around with LC's own version of the new Dropbox library and it keeps returning me the same error: Can't find handler
I have simplified it to one button: "Button1" with the following lines:

Code: Select all

put "Hola senorita" into myData
dropboxUpload "MyAuth2Code" , "/test.csv", Overwrite, false, true, myData, false
it keeps giving me the error at line 2 of the code: "DropboxUpload ........"
Any ideas?

thanks!

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

Re: Guillermo's Dropbox lib

Post by Mikey » Sun Jun 18, 2017 1:52 pm

myauth2code, if it's a container, should not be quoted.
How are you including LC's library?

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Re: Guillermo's Dropbox lib

Post by Zood » Mon Jun 19, 2017 1:11 pm

Hey Mikey,

What do you mean by including LC's library?

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

Re: Guillermo's Dropbox lib

Post by Mikey » Mon Jun 19, 2017 1:35 pm

What is the structure of your project? Is LC's library set as a substack? Did you "start using stack", etc? The "Can't find handler" message suggests that the library isn't in the message path.

simon.schvartzman
Posts: 224
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Guillermo's Dropbox lib

Post by simon.schvartzman » Wed Jun 21, 2017 9:38 pm

Mickey, where can I download LC9 DP7 from?

As per your suggestion I've downloaded the new LC Dropbox library and now need to have access to the documentation.

FYI I intend to use the library with LC8 for which I own an indy license.

Many thanks for your support
Simon
________________________________________
To ";" of not to ";" that is the question

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

Re: Guillermo's Dropbox lib

Post by Mikey » Wed Jun 21, 2017 9:59 pm

Downloads.livecode.com

Post Reply

Return to “Talking LiveCode”