Zhorn Software
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
goppi
Posts : 13
Join date : 2019-01-24

API and Stacks Empty API and Stacks

Thu Jan 24, 2019 9:07 pm
Hi.

Just took a look at the API but what I did not find were some stack related functions.
To get a complete list of stickies via API I also need to get a list of stickies within a stack which I did not find.
Same thing to create a sticky within a stack.

Did I overlooked anything?

THX
avatar
Guest
Guest

API and Stacks Empty Re: API and Stacks

Fri Jan 25, 2019 11:32 am
I could not find api's for listing or creating content in stacks but you can work around it.

To get info or list you can parse the stickies.ini  file it contains everything you need.
To create a sticky in a stack you can use the api  " do new encoded <encoded string> " you only have to provide the parameters you need ( and stack the number : stack<1> ).

P.S. You need to create an Unique ID number for each sticky in the encoded string.
avatar
goppi
Posts : 13
Join date : 2019-01-24

API and Stacks Empty Re: API and Stacks

Fri Jan 25, 2019 11:39 am
Thanks for the suggestion, indeed this should work.

Regards,

goppi
Admin
Admin
Admin
Posts : 566
Join date : 2018-03-30
Location : London
http://www.zhornsoftware.co.uk

API and Stacks Empty Re: API and Stacks

Sat Feb 02, 2019 5:18 pm
What API commands would be useful?  Sookye is right, you can go to the ini file, but interaction with Stickies "ought" to be through the API so that when I change something internally, I do the work to ensure the API stays working, not you.  The ini file is changing for the next release, so it's probably best you work to API commands from now to avoid having to re-do work later!

Tom
avatar
goppi
Posts : 13
Join date : 2019-01-24

API and Stacks Empty Re: API and Stacks

Sat Feb 02, 2019 9:41 pm
Hello Tom,

thanks for taking the time to answer my question.
What you say is entirely correct.
Using the API is always the best option and that was my intention first.
If however there is something you could not do via API you have no choice to use the INI directly.
What is a general requirement IMHO is the possibility to retrieve all kind of stickies which exist. From what I can see currently you can only retrieve some kind of stickies but you will always miss some of them. E.g. how do you retrieve stickies which are part of a stack? You can call "get list stacks" to get all stacks but what to do next if you want to get the stickies which are part of a stack? Same for recurring stickies.



Cheers goppi.
Admin
Admin
Admin
Posts : 566
Join date : 2018-03-30
Location : London
http://www.zhornsoftware.co.uk

API and Stacks Empty Re: API and Stacks

Sat Feb 02, 2019 9:51 pm
Start with:

get list desktop

That includes both those note in and out of a stack.

To determine whether any in the list which that command returns, use:

get desktop <id> encoded

You'll need to parse the string which comes back - look for <STACK> followed by an integer which is the stack number.  As you've found, you can get all the stacks in a list already.

If you want recurring notes, use:

get list sleeping

Again, retrieve them in turn, and look for <RECURRING> in the string which the app passes you.

Hope this helps?

Tom
avatar
goppi
Posts : 13
Join date : 2019-01-24

API and Stacks Empty Re: API and Stacks

Sun Feb 03, 2019 12:18 pm
Hi Tom.

Thanks for your detailed explanations.
From what I have understood now all I was looking for is possible with API functions already in place.

I had good reasons to start this thread with "Did I overlooked anything?" which seems to be the case here.

Cheers

goppi.
Sponsored content

API and Stacks Empty Re: API and Stacks

Back to top
Permissions in this forum:
You can reply to topics in this forum