[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)
I was going to suggest a similar solution but nickr beat me to it.
Because each run won't leave a simple way to access a memory stored variable, I would create and destroy a token file.

Something like:
Code:
import xbmc, xbmcvfs

pth = xbmc.translatePath('special://userdata/addon_data/service.xbmc.callbacks2')
fn = xbmc.translatePath('special://userdata/addon_data/service.xbmc.callbacks2/token.txt')
if not xbmcvfs.exists(pth):
    xbmcvfs.mkdirs(pth)

if xbmcvfs.exists(fn):
    xbmcvfs.delete(fn)
    #  No code to execute here
else:
    with open(fn, 'w') as f:
        f.write('X')
    pass  # Your code goes here or call subprocess to launch something else

Disclaimer: I didn't actually test this code yet
Reply


Messages In This Thread
Great! - by gnorf - 2013-02-27, 22:50
[RELEASE] Pilulli Revisited - by KenV99 - 2014-06-28, 18:18
RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - by KenV99 - 2015-11-22, 22:37
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)4