start Script with arguments
#1
hi.

at the moment i'm working on a script to download icons from the new page http://xbmc.ckdvt.com.

everything works fine.

but here's the idea:
i would create a button in the contextmenu of xbmc maybe named "get thumb".
by clicking this button the script starts and gets the filepath of the file wich was selected on tapping the white button.

is there any way to get the path of the selected file via python?
i tried httpapi and i was thinking about something like "skin.hassetting(bla)" but i had no success.

thanks in advance.
Reply
#2
not sure, but you can maby do some trix:
use the getguistatus from httpapi, before you bring up pythonguistuff. this will read of the current guistatuses on xbmc.
the output will look something like this, atleast it was like this
aug. 30 2005. maby there are more info added?

Quote:musicpathConfusedmb://username:[email protected]/e/
videopath:?
picturepath:?
programspath:?
filespath1:?
filespath1:?
activewindow:10501
activewindowname:my music/files
controlid:50
type:list
description:[apps]

anyway, here you have the controlid, witch you can use to parse the xml files of the skin, to lookup the graphic.
in theory it should work :p


hmm, you would probably get the id of your getthumbbutton.
well i'm out of ideas.



Reply
#3
thanks for your reply.

thats right.
i probably would get the thumbbutton Wink

but however..
the information i can get about getguistatus are not enough.
i need a complete path of the exact file to save the downloaded icon.
Reply
#4
rockstarr, what would be even nicer, is if you would get the folder list of tdata or udata forget which one. then the website would save the icons as say 0x5553004d.png. then if you could get the folder info from the correct file in tdata/0x5553004d/ you could save the icon as default.tbn automatically.

by the way 0x5553004d is ghost recon 2 - summit strike



For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
at the moment the icon is autmaticly saved as "default.tbn", "filename.tbn" or "folder.jpg".
it works with games, apps, movies, folders and other files.

what you said is only interesting for searching gameicons.
this is atm done with the foldername of the game (or manually)
but i also dont know how to get the name of the savegame of a game.

but thats not the main problem. Wink

thanks for your post annyway


the script works fine with selecting game (or file or folder), search icon and save it.
i'm just looking for the possibility to start it from contextmenu and give it the path of the selected file.
Reply
#6
i forgot about movies...

anyways, i think it's been asked before, but if the infolabels could be exposed to python, then a listitem.filename or listitem.path could be added.

i think i could add the infolabel, but exposing it to pythonHuh

since you would have to edit the source code to add a command to the context menu, maybe you would know how?

you might be better if infolabels and python could happen, is just adding a button to the skin in each of the windows that ran the script?

not sure since they're in a feature freeze if any developer would look at this or not.

good luck, it seems like a nice feature.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
start Script with arguments0