Page 1 of 1

Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 11:24 am
by totallyLost
Hello all,

I'm not newbie enough to not know I can use "Write to File" to make a text file but newbie enough to not know if it's possible to use "Write To File" to "write" to a Keep note on Window 10? Please enlighten me :?

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 11:37 am
by Klaus
Hi totallylost,

as a Mac user I don't have the slightest idea what you are talking abount, resp. I am totally lost here. :-)

Best

Klaus

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 11:45 am
by Klaus
Oh, sorry, and welcome to the forum! :-)

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 11:59 am
by totallyLost
Thanks for posting, Klaus (I used to be a Mac user, too)!

I should've made myself clearer, sorry. I'm using Google Keep to organize my notes. I sudden thought it would be really useful if Livecode apps could communicate with Google Keep (that is, the texts in the field on a card can be written to a Google Keep note). I know I can use the script "open file tFile for text write" to write to a text file onto the harddisk. Not knowing coding enough, I absolutely have no idea if this is even a stupid question :P

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 12:08 pm
by Klaus
Never heard of Google Keep, but
1. if this app (it is an application, right?) stores its files separately for each note in simple text format
2. and you know how these text files are structured internally and
3. you know where these files are stored
then this is surely doable. 8)

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 12:13 pm
by stam
Hi @totallyLost
So really nothing to do with Windows 10 or any other OS.
It's to do with Google Keep. That probably doable but has nothing to do with 'write to file' which writes a text to a file that has been opened with 'open file for write'.

As google is an online service you need to leverage it's REST API: https://developers.google.com/keep/api/reference/rest
The commands you'll need are likely 'set the htmlHeaders' and put/get/post to URL

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 12:31 pm
by Klaus
AHA! :-)
Thanks for the clarification, stam!

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 12:41 pm
by stam
Note that it's not that straightforward... I'm no expert but think you need to create a google cloud developer account (from console.cloud.google.com, start a free trial - I think you'll never need to pay for single user access, but can't confirm), and create a private key for your openID (I think...)
You will probably have to log in with Oauth prior to using the Keep API, or google won't know who the data belongs to...

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 1:06 pm
by totallyLost
Thank you so much for your input, stam!! What you described certainly goes past my basic hypercard-level understanding. But I'll leave that project on my bucket list and I'd share if I were able to inch forward; thanks again, Klaus and stam!

Re: Possible to use "Write To File" to save a Keep note on Window 10?

Posted: Mon Feb 12, 2024 1:30 pm
by stam
Let us know how you get on!

Logging into google cloud services with oauth2 and manipulating their cloud apps is certainly one of the things I've been meaning to learn, but it's much lower priority so haven't got round to it (yet)...

I know people have had varying degrees of success with it but suspect older examples are no longer valid because Google has a habit of forgetting the past, changing things as it sees fit and even dropping services with little/no warning. But it should be doable!