Kodi Community Forum
Win XBMC Startup in folder - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: Win XBMC Startup in folder (/showthread.php?tid=140516)



XBMC Startup in folder - Lakigucci - 2012-09-14

Is there a way that when my XBMC starts it automaticly goes to my video->folder->movies(custom folder)?

And if so, how? ima nub in code's so i hope thats not the way.


RE: XBMC Startup in folder - artrafael - 2012-09-14

Assuming that folder can be accessed within XBMC, you can do the following:
  1. In XBMC: Videos > Files
  2. Drill down to the page that shows this folder, highlight the folder name and open the context menu ("c" on keyboard or right mouse button)
  3. Select "Add to favourites"
  4. Exit XBMC and locate the favourites.xml file in your userdata (wiki) directory
  5. Open the file with a text editor and locate the statement for your folder. It should look something like this:
    Code:
    <favourite name="your-folder-name">ActivateWindow(...)</favourite>
    (where "..." represents the actual text that is in this statement)
  6. Make a note of the ActivateWindow(...) text from the statement
  7. See this post to create an autoexec.py file. However, in your script, use the ActivateWindow(...) text you copied from favourites.xml instead of ActivateWindow(Videos,Files) as shown in the example. So the resulting script statement will look like this:
    Code:
    xbmc.executebuiltin("ActivateWindow(...)")
  8. Launch XBMC and it should open up to your folder.

EDIT: Corrected misspelling in Step 7. Should be: autoexec.py


RE: XBMC Startup in folder - Lakigucci - 2012-09-15

Wow thnx man. I could never figure it out myself.
Gonna try as soon i get home!

Thnx somuch


RE: XBMC Startup in folder - mike_m - 2013-08-26

Sorry to revive an old thread but this is achingly close to what I'm trying to do. However the script takes me to a blank list/window. Accessing through Favorites jumps to the right place but the same ActivateWindow command in a python script doesn't.

Favorites.xml:
Code:
<favourite name="Movies">ActivateWindow(10025,&quot;smb://MEDIA1/media1/Movies/&quot;)</favourite>

python script:
Code:
xbmc.executebuiltin( "ActivateWindow(10025,&quot;smb://MEDIA1/media1/Movies/&quot;)" )

Frodo 12.2

What am I doing wrong?


RE: XBMC Startup in folder - artrafael - 2013-08-26

Probably because the SMB share isn't yet available to XBMC at the point in time when the autoexec.py is executed. On the other hand, by the time you get to launching the favourite, the share is now available. You may need to add a delay/check in your script to allow the share to become available before you run your xbmc.executebuiltin statement.


RE: XBMC Startup in folder - artrafael - 2013-08-26

I just played around with this for a bit. Try changing your statement to:
Code:
xbmc.executebuiltin( "ActivateWindow(10025,smb://MEDIA1/media1/Movies/)" )
and see if this works.


RE: XBMC Startup in folder - mike_m - 2013-08-26

@artafael

That works. Thank you!