[HOW TO] Speed Dial Favourites

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MediaPi Offline
Fan
Posts: 745
Joined: Apr 2013
Reputation: 8
Post: #1
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
(This post was last modified: 2015-04-09 00:24 by MediaPi.)
find quote
k4sh1n Offline
Posting Freak
Posts: 764
Joined: Jun 2011
Reputation: 17
Post: #2
Thank you and nice leverage of Autoexec.py, can you request this be moved to the tips and trick section Smile
find quote
MediaPi Offline
Fan
Posts: 745
Joined: Apr 2013
Reputation: 8
Post: #3
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
(This post was last modified: 2015-04-09 00:22 by MediaPi.)
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 25,912
Joined: Jan 2011
Reputation: 362
Location: Arizona, USA
Post: #4
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.

You can make easy links to the Kodi Wiki Manual using double brackets around common Kodi words: [[debug log]] = debug log (wiki), [[Video library]] = Video library (wiki), [[SMB]] = SMB (wiki) , [[userdata]] = userdata (wiki), etc
(This post was last modified: 2015-04-09 00:50 by Ned Scott.)
find quote