Posted by: pierrot | on January 10, 2017
Posted in | 4 Comments » Tags:
< ![CDATA[
Use EventHandler.setNext. Actions are chained. You defined the first, then link to the next one. The last one has no next (it’s null).
lightninglauncher.com – EventHandler
]]>
I want to add an action in the launch action – > list of action, but I can find how get that.
I locate i.tap but is different
I thing I’m a little lost
Launch action is encoded in the intent (use Shortcut.getIntent()), but there’s no function to decode it from script.
If possible, override it with the tap action. Try something like this (not tested for syntax errors):
var props = item.getProperties();
var h = props.getEventHandler(“i.tap”);
h.setNext(new EventHandler(some_action, some_data);
props.edit().setEventHandler(“i.tap”, h).commit();
tks I got it, this how finally I made
var d = LL.getCurrentDesktop();
var pnl = d.getItemByName(“pnl”);
var items=pnl.getContainer().getAllItems();
for (i in items){
var intent = items[i].getIntent();
var props = items[i].getProperties();
// launch app
var launchEH=new EventHandler(20, intent.toUri(0));
var setVEH=new EventHandler(41,”pTop/$hideP”);
launchEH.setNext(setVEH);
props.edit().setEventHandler(“i.tap”, launchEH).commit();
}
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
< ![CDATA[
Use EventHandler.setNext. Actions are chained. You defined the first, then link to the next one. The last one has no next (it’s null).
lightninglauncher.com – EventHandler
]]>
< ![CDATA[
I want to add an action in the launch action – > list of action, but I can find how get that.
I locate i.tap but is different
I thing I’m a little lost
]]>
< ![CDATA[
Launch action is encoded in the intent (use Shortcut.getIntent()), but there’s no function to decode it from script.
If possible, override it with the tap action. Try something like this (not tested for syntax errors):
var props = item.getProperties();
var h = props.getEventHandler(“i.tap”);
h.setNext(new EventHandler(some_action, some_data);
props.edit().setEventHandler(“i.tap”, h).commit();
]]>
< ![CDATA[
tks I got it, this how finally I made
var d = LL.getCurrentDesktop();
var pnl = d.getItemByName(“pnl”);
var items=pnl.getContainer().getAllItems();
for (i in items){
var intent = items[i].getIntent();
var props = items[i].getProperties();
// launch app
var launchEH=new EventHandler(20, intent.toUri(0));
var setVEH=new EventHandler(41,”pTop/$hideP”);
launchEH.setNext(setVEH);
var h = props.getEventHandler(“i.tap”);
props.edit().setEventHandler(“i.tap”, launchEH).commit();
}
]]>