Kodi Community Forum
Start script with onclick? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+--- Thread: Start script with onclick? (/showthread.php?tid=56935)



Start script with onclick? - Bytefire - 2009-08-26

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


- spiff - 2009-08-26

typo. executescript != excecutescript


- Nuka1195 - 2009-08-26

XBMC.RunScript()


- spiff - 2009-08-26

lol even worse typo Smile thanks for pointing that out Wink


- Bytefire - 2009-08-27

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.


- Nuka1195 - 2009-08-27

no quotes or single quotes


- Djape - 2009-08-27

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


- Bytefire - 2009-08-28

Nuka1195 Wrote:no quotes or single quotes

goddamn quotes!!!
it works now, THANKS A LOT Laugh


- Djape - 2009-09-01

Glad to see you worked that out Wink


RE: Start script with onclick? - mohammadsaeed01 - 2018-09-02

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?


RE: Start script with onclick? - Quihico - 2018-09-03

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)



RE: Start script with onclick? - DaVu - 2018-09-03

For using the ID you are also able to use: RunAddon(ID)