Add your own favourite from a button ?
#1
Hello all,
I was just wandering if anyone knows a way of how to add your own favourite from a button click. (Not from the context menu)
I have testing out the favourites script and it works perfectly for listing favourites, but is there any way that i could create my own button to add one myself ?

I have been doing a little bit of testing with the favourite properties and i have found out how to add 1 favourite to the Favourite.32.Path like this :

PHP Code:
<item id="4">
                                <
description>Games</description>
                                <
label>Pin</label>
                                <
thumb></thumb>
                                                    
                                    <
onclick>Dialog.Close(1223)</onclick>
                                    
                                                       <
onclick>SetProperty(favourite.32.PathActivateWindow(8889),0)</onclick
                                                       <
onclick>SetProperty(favourite.32.Thumb$INFO[Skin.String(GamePoster)],0)</onclick
                                                        <
onclick>SetProperty(favourite.32.Name$INFO[Skin.String(GameName)],0)</onclick
                                                       <
onclick>Skin.ToggleSetting(32)</onclick>
                                                       <
visible>!Skin.HasSetting(32)</visible>
                            </
item

And to remove the favourite i have used this :

PHP Code:
<item id="5">
                                <
description>Games</description>
                                <
label>Unpin</label>
                                <
thumb></thumb>
                                                    
                                    <
onclick>Dialog.Close(1223)</onclick>
                                    
                                                       <
onclick>ClearProperty(favourite.32.Path,0)</onclick
                                                       <
onclick>ClearProperty(favourite.32.Thumb,0)</onclick
                                                        <
onclick>ClearSetProperty(favourite.32.Name,0)</onclick
                                                       <
onclick>Skin.ToggleSetting(32)</onclick>
                                                       <
visible>Skin.HasSetting(32)</visible>
                            </
item



But the problem is that this is only for Favourite id 32 and there are 31 others.
The other thing is that XBMC will forget the favourite every time you restart.


The reason that i am asking this is because i would like to add a pin/unpin button to some of my windows on my Xbox One skin. Like the game details, or movies ect. It saves opening up the context menu and having to scroll through everything. Also the context menu can't be accessed from some sections.

Thanks in advance for any help or suggestions.
Reply
#2
Hello toyota12303

I tried something similar,but without success.Now I test it with snap string possibilities.

Best Regards
Reply
#3
Hello senna99,
i have just tested out your snap script and it's working perfectly! the only problem that i am getting is that it won't keep focus when using XBMC.
Also i have written a little script that will detect your resolution and run the correct program for it. This would be perfect for the snap scripts. E.g. if your screen is 720p it would open snap720p.exe. I can send you a link if you want ?

Best Regards

I have had another idea on how to do this but it still isn't working.

I have tried creating a python script that will write the favourite in to the favourites.XML
This would be perfect if i could get it to work as XBMC would remember it.

Here is what i have tried out :

PHP Code:
open("C:\Users\Xbox\AppData\Roaming\XBMC\userdata\favourites.xml""a");
print 
f

value 
xbmc.getInfoLabel'$INFO[Skin.string(Favourite1)]' )
myString str(value)

f.write(myString)

f.close() 

And i have tried setting the string using :

PHP Code:
Skin.SetString(Favourite1, <favourite name="Escape Plan" thumb="http://image.tmdb.org/t/p/original/1jHF5or25uCZr7O5c7CYm9eTrTw.jpg">PlayMedia(&quot;F:\\Downloads\\Escape Plan (2013)\\Escape.Plan.2013.720p.BluRay.x264.YIFY.mp4&quot;)</favourite>) 
and
PHP Code:
Skin.SetString(Favourite1"<favourite name="Escape Plan" thumb="http://image.tmdb.org/t/p/original/1jHF5or25uCZr7O5c7CYm9eTrTw.jpg">PlayMedia(&quot;F:\\Downloads\\Escape Plan (2013)\\Escape.Plan.2013.720p.BluRay.x264.YIFY.mp4&quot;)</favourite>") 
and
PHP Code:
Skin.SetString(Favourite1'<favourite name="Escape Plan" thumb="http://image.tmdb.org/t/p/original/1jHF5or25uCZr7O5c7CYm9eTrTw.jpg">PlayMedia(&quot;F:\\Downloads\\Escape Plan (2013)\\Escape.Plan.2013.720p.BluRay.x264.YIFY.mp4&quot;)</favourite>'
and then i just tried simply setting the string like this :
PHP Code:
Skin.SetString(Favourite1TestText

And it still didn't work! I thought that there may be a problem with the python script as my skills with python aren't very good but i tried changing it to write the string in a text file on my desktop and it worked fine. For some reason it won't let me write anything in to the Favourites.xml

I doubt that i would be able to set the whole favourites line as a string because it contains multiple symbols that won't work with it. But it's weird that it won't let me write any text in the favourites.
Reply
#4
Hello
Following these codes everything should be work.I do not understand what is missing.
Reply

Logout Mark Read Team Forum Stats Members Help
Add your own favourite from a button ?0