If you add a shortcut by script (to a folder in my case), you can change its properties, but these are not persisted.

If you add a shortcut by script (to a folder in my case), you can change its properties, but these are not persisted. They show at first, but vanish after i.e. LL restart. Tried LL.save() of course, but no success. Also sc.setLabel(“other label”) is lost, so basically anything you change after adding.

var sc=fld.addShortcut(“lbl1”, null, 0, 0);

sc.setLabel(“lbl2”);

var ed=sc.getProperties().edit();

ed.{whatever}

ed.commit();

LL.save();

EDIT: I have to correct myself. Property changes ARE persisted… all except changes to “i.box”. And this happens not only for newly added shortcuts, but also for existing.

]]>

11 Commentsto If you add a shortcut by script (to a folder in my case), you can change its properties, but these are not persisted.

  1. Anonymous says:

    < ![CDATA[

    For the label be sure to call sc.setLabel(“lbl2”,true);


    Otherwise the label is not persistent.


    The property changes work good for me, but I didn’t tried with a trough script created shortcut…

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Lukas Morawietz Thanks.


    Yes, works with shortcuts in general, but not with created. Those not even do have an ID. Create and modify by script, LL.save, then manually customize anything in folder settings, shortcut changes are gone

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Pierre Hébert Seems like the order is: shortcut created, modified, rendered, THEN overwritten with container defaults.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Sorry, I have to correct myself. Property changes ARE persisted… all except changes to “i.box”. And this happens not only for newly added shortcuts, but also for existing.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Thanks for the info, I was trying to reproduce it  without success but I didn’t notice your last message 🙁 Now everything is clear, I see where the problem is, thanks.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Pierre Hébert My bad, should’ve analyzed better before posting. Good to hear you found the issue.



    Am starting to like scripting 😉

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Great 🙂


    One weak point is however the editor.

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Pierre Hébert Script Editor? Am using Quoda as external editor, works great.



    Found another issue with “addShortcut” related to folders, will report seperately.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    An external editor is a semi satisfying solution.  As scripting does not work too bad, it would be nice to get a better integration, such as going directly to the right line on error, better completion, etc.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Pierre Hébert *grin* I suggested a while ago but was directed to external editor so LL wouldn’t get bloated.


    You did a great job on the editor, REALLY! That completion feature is what I mainly miss in external editor.


    Line numbers are missing, yes, that has to be added. Syntax highlighting… I don’t know… not really necessary.


    Font or at least size should be adjustable, way too big currently. And scrolling by flinging does not work.



    If you plan to add a better editor, do it as add-on. With tighter integration as external editors, but still decoupled. Keep LL small, please!

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Exactly. At this time I said that LL is not an IDE 😉 I don’t plan to write one and I don’t have the time for that. What I would like is to either improve integration with an existing one, or create an external one based on an existing editor, such as Ted (https://github.com/xgouchet/Ted)

    ]]>

Leave a Reply

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