Start script with onclick?
#1
Hello

i wanna start my internet browser directly from the main Menu(without clicking 10 times trough a launcher...). How can i manage that? i already tried the executescript function with onclick:

PHP Code:
...
<
onclick>xbmc.excecutescript('/home/testuser/apps/ov_webbrowser/xbmc/start_webbrowser.sh')</onclick>
... 

but it won't work!

when i put this line (without the onclick) into the autoexec.py it starts.

someone got the idea to get this working?

thanks for reading
greets
Reply
#2
typo. executescript != excecutescript
Reply
#3
XBMC.RunScript()
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#4
lol even worse typo Smile thanks for pointing that out Wink
Reply
#5
ok, lol typo only in the post
i didn't wrote "eXCEcutescript" in my sourcecode

well i now tried:

PHP Code:
...
<
onclick>XBMC.RunScript('/home/testuser/apps/ov_webbrowser/xbmc/start_webbrowser.sh')</onclick>
... 

but it didnt work either Sad


if i start the .sh file from my gnome terminal it works, so the file is executable and ok.
Reply
#6
no quotes or single quotes
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#7
Ehm,

a little bit off topic maybe, but regarding your browser starting.

When you start browser, do you actually close xbmc and start fluxbox session or browser is opened on top of the xbmc?

I'm using xbmc live and if I open browser directly from xbmc it will not allow me to do anything, it just stays on top but all keys are moving in xbmc.

Am I missing something, or this is normal behavior.

Thx and good luck with the script Wink
Reply
#8
Nuka1195 Wrote:no quotes or single quotes

goddamn quotes!!!
it works now, THANKS A LOT Laugh
Reply
#9
Glad to see you worked that out Wink
Reply
#10
Hi Guys

I treid this in libreELEC but didn't work with me!
 <item id="80">
                                          <description>Browser</description>
                                          <icon>backgrounds/Browser.jpeg</icon>
                                          <label2>icons/Browser.png</label2>
                                          <label>Browser</label>  
                                          <onclick>XBMC.Runscript(/storage/.kodi/addons/browser.chromium/default.py)</onclick>
                    </item>


the logs are:

13:19:30.823 T:140499294496512   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: No valid addon id could be obtained. None was passed and the script wasn't executed in a normal xbmc manner.
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/browser.chromium/default.py", line 32, in <module>
                                                __addon__ = xbmcaddon.Addon();
                                            RuntimeError: No valid addon id could be obtained. None was passed and the script wasn't executed in a normal xbmc manner.
                                            -->End of Python script error report<--

Any Help please?
Reply
#11
Since that browser.chromium seems to be a proper addon, you should be able to run it by just using its id and not the full path to the default.py.
You also do not really need the XBMC-prefix so that would make for:
python:
RunScript(browser.chromium)
Reply
#12
For using the ID you are also able to use: RunAddon(ID)
Reply

Logout Mark Read Team Forum Stats Members Help
Start script with onclick?0