What is this error?
What is this error?
It’s from a script run on the new resume event of a folder.
]]>« Universal bug fix guide (Previous Post)
(Next Post) Zunish – a zune-based Lightning Launcher eXtreme setup with your best user experience in mind. »
< ![CDATA[
This is the script:
var d3 = LL.getDesktopByName(“3”);
var menu = d3.getItemByLabel(“Menu bar”);
alert(menu.getLabel());
var items = menu.getItems();
for ( var nItem = items.getLength() – 1; nItem >= 0; nItem-= 1 )
{
var item = items.getAt(nItem);
if (item.getType() != ‘Folder’)
continue;
//setTimeout(function(){item.open();}, 20);
return;
}
alert(“no folders found in menu”);
]]>
< ![CDATA[
I think the problem is the return statement, try a break instead.
(of course the last line has to be changed somehow, it would not make sense)
]]>
< ![CDATA[
That error happens when you run a script that have an alert from another script.
I tried yours (with little modification regarding items) and it works ok.
Is there a different script run in the middle? Is it the ‘openmenubar’ the script you posted here? Is it the one that is run in the event?
]]>
< ![CDATA[
TrianguloY the script I posted above is “onMenuResume”
“OpenMenuBar” is this:
var d = LL.getCurrentDesktop();
if (d.getHeight() > d.getWidth())
{
/*
d = LL.getHomeDesktop();
LL.goToDesktop(d.getId());
*/
var d3 = LL.getDesktopByName(“3”);
var menu = d3.getItemByLabel(“Menu bar”);
menu.openFrom(0, d.getHeight()/2);
menu.getContainer().setPosition(0, 0, 1, false);
/*
menu.launch();
*/
}
]]>
< ![CDATA[
So you are launching a script while executing another script.
Is the script run because you are launching the item?
For some reason one script is being executed while another one is running. Try to find this behavior.
]]>
< ![CDATA[
It looks like a censor problem :p
]]>
< ![CDATA[
Basically this is as TrianguloY said. It will happen when a second script execution is started while another one is paused. Another script can be paused if it is waiting for a user response on a dialog. This is a caveat of the runScript implementation that I cannot overcome.
]]>
< ![CDATA[
Pierre Hébert I don’t use runScript. This is something else.
Maybe because the resume event is called when the folder is opened from script.
I already posted the two scripts I use. The first one “inMenuResume” is on the resume event, the other one “OpenMenuBar” is called from a swipe event on any desktop, opening the folder.
]]>
< ![CDATA[
Yes, in fact each script execution is a runScript invocation
]]>
< ![CDATA[
So is there a workaround?
]]>
< ![CDATA[
Manage to don’t use alerts in the inMenuResume
Omit them, use a variable to check if the other is still running…
]]>
< ![CDATA[
TrianguloY the first alert shows just fine, the last one never executes anyway. The error is still there. I found a way to not use the resume event, but it’s not a general solution.
]]>
< ![CDATA[
Seems that I can’t set paused or resume events on folders that are opened from script or else the error occurs. Is there any way to either fix this somehow or have the close and open methods have a bool that triggers or no the resume and paused events.
]]>