QUOTE
<Settings>
...
<xbmcscripts>F:\applications\xbmc\scripts</xbmcscripts>
...
</Settings>
...
<Menu>
...
<Item Action="XbmcMovie" Arg1="F:\video\movie.avi">Movie.avi</Item>
when launched, this would create a file in the xbmc scripts directory named 'ux_autoexec.py' it would write the following to that file and then launch xbmc.
QUOTE
xbmc.Player().play('F:\\video\\movie.avi')
of course, this can already be accomplished with UX batch-lists (except for the writing to the file). chances are that if you are statically linking a movie in your menu, you won't mind creating this one-line python script on your own and keeping it tucked away somewhere.
QUOTE
...
<Item Action="XbmcScript" Arg1="F:\python-scripts\game-script.py">Game-script</Item>
...
this would copy F:\python-scripts\game-script.py to the xbmc scripts directory as ux_autoexec.py Again, this can already be accomplished too with batch-lists, but if the one above is implemented, why not this one too?
QUOTE
...
</Menu>
both of these items would take advantage of an autoexec.py script that i've come up with for xbmc. the autoexec.py would look for ux_autoexec.py and run it and nothing else. if it didn't find ux_autoexec.py, it would run xbmc_autoexec.py (which would be the user's original autoexec.py). here is the autoexec.py i came up with for doing this sort of thing:
CODE
# auto execute scripts when xbmc starts, place this file in %xbmchome%\scripts\
#
# note: - do not execute more than one script at a time which asks for user input!
# modified as a hacked way of passing parameters to xbmc from UnleashX
# or any other app that can rename and move files around.
#
# autoexec.py - this script - it will run everytime when xbmc finishes loading
# ux_autoexec.py - script placed in your script directory by UnleashX
# ux_temp.py - ux_autoexec.py will be renamed to this and executed so it is not run everytime you run xbmc
# xbmc_autoexec.py - rename your original autoexec.py to this
#
# how it works:
# Unleashx will copy the desired script to %xbmchome%\scripts\ and rename it to
# ux_autoexec.py. then UnleashX will launch xbmc. xbmc will execute this script.
# this script will attempt to rename ux_autoexec.py to ux_temp.py and run it.
# the renaming process prevents the script placed here by UnleashX from running
# everytime xbmc loads. if ux_autoexec.py does not exist, the rename will throw
# an OSError exception and the script will not try to launch ux_temp.py. instead
# it will try to launch xbmc_autoexec.py.
import xbmc, xbmcgui
from os import rename, remove
try:
remove('q:\\scripts\\ux_temp.py')
except OSError:
pass
try:
rename('q:\\scripts\\ux_autoexec.py', 'q:\\scripts\\ux_temp.py')
xbmc.executescript('q:\\scripts\\ux_temp.py')
except OSError:
xbmc.executescript('q:\\scripts\\xbmc_autoexec.py')
NOTE!!! Python needs tab-indentions and the board eradicated them from the above script!yeah, i know this last one is really far out there, but i thought i'd just throw it out there for people to think about anyway.