How to stop another script from a service script
#1
Hi

i try to start / stop a script from a servicescript when a push button is pressed.

starting the script with

s='XBMC.RunAddon("script.module.input",Relais='+str(nr-3)+')'
        xbmc.executebuiltin(s)

works very welll

but i have not  found a way to stop it.

When i try it with

xbmc.executebuiltin('XBMC.StopScript("script.module.input")')

it doesn´t work and kodi.log shows


CPythonInvoker(6, /storage/.kodi/addons/script.module.input/addon.py): script didn't stop in 5 seconds - let's kill it

script.module.input has a modal dialog with home button . If i press the Home button script closes as expected

Any help ?

Martin
Reply
#2
Thread moved to addon development
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
i've tested it and StopScript() indeed doesn't seem to work (at least not or scripts that create a GUI).

perhaps you could try xbmc.executebuiltin('Action(Back)') or xbmc.executebuiltin('Dialog.Close(all,true)') instead?
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(2017-12-29, 15:58)ronie Wrote: i've tested it and StopScript() indeed doesn't seem to work (at least not or scripts that create a GUI).

perhaps you could try xbmc.executebuiltin('Action(Back)') or xbmc.executebuiltin('Dialog.Close(all,true)') instead?
 both methods works well. Thank you very much

Martin
Reply
#5
I'd like to resurrect this question, because I've run into the same problem where StopScript doesn't seem to be working. I would like to do something like:

xbmc.executebuiltin('XBMC.StopScript(.../.kodi/userdata/myscripts/playgreen.py')

'playgreen' is a kind of smart playlist that starts a number of videos sequentially. This script doesn't generate any gui boxes that I could click to kill it, so I would need a different solution, but I'm at a loss.

Any ideas?
Reply

Logout Mark Read Team Forum Stats Members Help
How to stop another script from a service script0