getItemByLabel seems to be broken, returns null often.

getItemByLabel seems to be broken, returns null often.

]]>
« (Previous Post)
(Next Post) »

8 Commentsto getItemByLabel seems to be broken, returns null often.

  1. Anonymous says:

    < ![CDATA[

    getItemByLabel is depricated.. You’ll want to switch to getItemByName

    ]]>

  2. Anonymous says:

    < ![CDATA[

    I know but pierre said old methods shouldn’t be broken by this, and also this is getting on my nerves. I have to set for every item the label as name to access it. Crap.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    make a script 🙂

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Done that oc

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Trying to understand: this is a script is using getItemByLabel with newly created shortcuts or folders, s this right ?


    If my assumption is correct, then getItemByLabel works with existing item because the update included some migration code that copied the old unique label over label AND name. Newly created items use fully distinct name and label, as a consequence the name is not set by default with the label.


    A workaround would be to use the label if name is not set. I think that Lutz Linke suggested this but I forgot to handle this case.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Pierre Hébert Yes, I think this fallback would be added. Name can be used in special cases to differentiate shortcuts, but in many (most?) cases the label should be used as name of not overridden.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Pierre Hébert Just to make sure: getLabel and setLabel for shortcuts will still remain, only getItemByLabel is deprecated, right?

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *