API suggestion:
API suggestion:
Array LL.getOpenFolders()
So we won’t need to search all the folders in all the desktops and check all the folders to see if it is open or not.
Edit: if possible, the folders in the array could be sorted depending on which is above. (Yes, I’m thinking in closing the top most folder just taking the first element)
]]>
< ![CDATA[
And Item LL.getItemById/Lable(…) also needed, I think, if we knew id/lable.
Javascipt looping takes so loooong than Java looping.
]]>
< ![CDATA[
TrianguloY that’s a good suggestion, I don’t know why I didn’t implemented it sooner.
KyungJoon Lee for getItemById this is possible to add this shortcut, but I am not too sure for getItemByLabel. The reason is that when using the id, it is possible to deduce the container immediately (the id is computed this way: 16 bits for the container id, 16 bits for the item id). But when looking for an item by name, you have to traverse and load all containers sequentially: this is very inefficient 🙁
]]>
< ![CDATA[
Ok I fully understood.
So if possible, please add LL.getItemById(). In multi subfolder environment, I observed too many reptitititiitive javascript for-loop.:)
]]>
< ![CDATA[
KyungJoon Lee I’ll do then !
]]>
< ![CDATA[
Would creating a hash of the label to the JavaScript object in the java code help? I’d guess labels would either have to be unique or you return an array.
Appols if you’ve already considered and discounted this.
]]>
< ![CDATA[
Although i didn’t try hash structure, my problem exists in other scene.
We store LL item object into javascript’s ojects(hash or simple variable). However I found javascript objects are not persistent.
For example, a certain crash of LL, and restarting LL destroys javascript cache. So I have to always have a way to get objects from LL efficeintly without looping routine work, in preparation for crash or something.
]]>
< ![CDATA[
My API suggestion:
We have setscripttag() and item.settag() but I am missing a container.settag()
]]>
< ![CDATA[
What’s with all the “we” talk?
Are there teams of LLX scripters?
I wanna join.
Lukas Morawietz try
container.getOpener().setTag
]]>
< ![CDATA[
Bogdan Tautu doesn’t work for desktops.
And if there is a official team I’m not in it :)
We are just exchanging experiences and help sometimes…
]]>
< ![CDATA[
Personally, when I use ‘we’ I’m referring to users in general 😉
]]>
< ![CDATA[
Vince Scott there might be several items with the same label but only one (the first found) will be returned. A hash would not really help because the real problem is to avoid laoding all (or many) desktops without knowing whether the item can be found. Building a hash requires the data to be loaded, which is expensive.
]]>
< ![CDATA[
Lukas Morawietz , Bogdan Tautu , TrianguloY : if there was a team of LLX scripters, then you would be the head, without any doubt 😉
I note the Container.setTag on the list, it makes sense since script and items have their own (but maybe not for the next version)
]]>
< ![CDATA[
Pierre Hébert 6 hours ago: “maybe not for the next version”
3 hours ago “script added: container.setTag()”
You are the best!
]]>
< ![CDATA[
Fun fact: I started scripting 12 days ago and have never written anything in javascript before ;)
What I want to say: everybody can script!
]]>