Kodi Community Forum

Full Version: [HOW TO] Speed Dial Favourites
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
say I put iplayer into favourites and want to access Iplayer

press favourites, locate iplayer, hover over iplayer, press enter.

but what if I could do this

press favourites, press 1 (this could be any key on your remote). THATS IT

this is how to

after you added favourites, you'll need to download the favourites.xml folder (in openelec its in xbmc./storage/.xbmc/userdata)

Code:
<favourites>
    <favourite name="iPlayer" thumb="/storage/.xbmc/addons/plugin.video.iplayer/icon.png">ActivateWindow(10025,&quot;plugin://plugin.video.iplayer/?content_type=video&quot;,return)</favourite>
</favourites>

now create a file and call it
Code:
1.py
and place this inside the file

Code:
import xbmc

xbmc.executebuiltin("Action(Back)")
cmd = ''
cmd = cmd.replace('&amp;',  '&')
cmd = cmd.replace('&quot;', '"')
xbmc.executebuiltin(cmd)

now from favourites take out the code that performs the action of opening iplayer
Code:
ActivateWindow(10025,&quot;plugin://plugin.video.iplayer/?content_type=video&quot;,return)

place this code in 1.py (like so)

Code:
import xbmc

xbmc.executebuiltin("Action(Back)")
cmd = 'ActivateWindow(10025,&quot;plugin://plugin.video.iplayer/?content_type=video&quot;,return)'
cmd = cmd.replace('&amp;',  '&')
cmd = cmd.replace('&quot;', '"')
xbmc.executebuiltin(cmd)

save file and place inside userdata folder (same place where you got favourites.xml)

Now create a file call it remote.xml (might have to call it keyboard.xml if kodi recognises your remote as keyboard

place this code inside remote.xml (if you named it keyboard.xml, where ever you see remote in the code replace with keyboard
Code:
<keymap>
  <Favourites>
    <remote>
      <one>RunScript(/storage/.xbmc/userdata/1.py)</one>
    </remote>
  </Favourites>
</keymap>

place this inside keymaps (/storage/.xbmc/userdata/keymaps)
you'll need to restart for it to work (only once needed)

now when you press favourites you got iplayer on speed dial number 1.
you could speed dial with any remote button on your remote, so in theory you could almost double the number of remote keys.
you can add more things into favourites and then map them for speed dial.
let me know what you think (P.S. the code was provided by Spoyser, thanks bud)

EDIT I'm still on Gotham so I'm not sure if you have to replace "xbmc" with "kodi" in the python script (for 1.py) also you could just map direcctly the action to a key but the beauty of doing it like this is you don't use up keys rather you have added keys to your remote

EDIT 2 each new button you assign as a speed dial, you'll need to create new python script files, so for example if I speed dialled button 2 I would need a new file for that (2.py) and for button 3 (3.py) etc
Thank you and nice leverage of Autoexec.py, can you request this be moved to the tips and trick section Smile
the credit goes to Spoyser, but I really appreciate your kind words, I'm not sure how to do a request, but if a mod is listening, could this please be consider to be placed in tips and tricks, thankyou
Thread moved :)

I haven't had time to test it yet, but I think some of the instructions/scripts can be simplified by using the special protocol (wiki) for the XBMC/Kodi folder (it will be called special://xbmc for the special protocol, even for Kodi). That way the path works for all OSes.

EDIT: Correction, you will want to use special://home for the Kodi settings folder.