I add some code into the script file UserMain, that i found on the forum:
procedure showMainWindow;
begin
SetUIProp(“fview”,“Visible”,“TRUE”);
end;
procedure hideMainWindow;
begin
SetUIProp(“fview”,“Visible”,“FALSE”);
end;
and then in javascript i run it like...