[MOD] Program Launcher Hack
#16
Interesting post. I was hoping to find something like this. I'm not familiar with python, but I'm wondering why you used a python script to call another script... why not just use a python script to do everything?
Reply
#17
Thanks for the script... finally got all the components working great...You should really emphasize Downloading the AutoHotKey Program and running the text file through there to make you launcher executable. Other than that I really appreciate it.
Reply
#18
Awesome post! Followed your directions and your write up for Hulu Desktop and it worked brilliantly, thanks so much!

Now for the tricky part - I'm trying to replicate the same effect (on click: close XBMC, draw black screen, open Hulu Desktop. on close of Hulu Desktop: draw black screen, open XBMC) but on a Linux box. I just pick up the low-end Acer Aspire Revo, and I'm trying to set it up as a dedicated media center (waiting of course for Flash 10.1 to make Hulu a little more watchable..)

Since these directions require ahk scripts and exe's, do you (or anyone else watching this thread) have a python script that would do the same thing and play nice with Linux? My programming experience is limited to copy paste and scratching my head online, so any suggestions would be great, thanks
Reply
#19
wups, sorry for these disregarded posts- a virus and a hard-drive crash eat up a lot of time Wink

Quote:Since these directions require ahk scripts and exe's, do you (or anyone else watching this thread) have a python script that would do the same thing and play nice with Linux? My programming experience is limited to copy paste and scratching my head online, so any suggestions would be great, thanks

There's a similar scripting language called AutoIT that I have heard works in Linux with WINE, beyond that I'm not aware of any scripts that will work.

Quote:Thanks for the script... finally got all the components working great...You should really emphasize Downloading the AutoHotKey Program and running the text file through there to make you launcher executable. Other than that I really appreciate it.

Sorry, yes, http://autohotkey.com

Quote:I'm not familiar with python, but I'm wondering why you used a python script to call another script... why not just use a python script to do everything?

I'm sure this is entirely possible, but I'm not familiar with python either. I just hit up their ref docs for like 10 minutes to learn how to launch an executable. I went with the 'man-in-the-middle' AutoHotKey for its ability to interface: draw the black GUI, wait for active windows, etc... that I don't think is in the Python scope. Basically, I wanted it to look seamless, not like you're launching another app within windows, but rather another part of XBMC.

Quote:This is the new error message:

"C:\PROGRA~1\XBMC\HULULA~1.EXEThe NTVDM CPU has encountered an illegal instruction.
CS:0dea IP:0241 OP:62 72 65 65 6e Choose 'Close' to terminate the application."

Now what's wrong?

The little more I have taught myself of python over the last months I learned 1 crucial thing: Whitespace MATTERS. Too many / not enough spaces and your script will fail big-time.


Quote:I'm launching beyondtv. After exiting that program there is a 20 seconds pause at a blank screen before xbmc launches again. Is this something that can be shortened in the code somewhere?

Yes it can - I'm guessing that you changed the executable where you declare the variables at the top since you're not getting an error, but you didn't change the window titles that the script is looking for:

you need to find the lines where it says things like:

Code:
winactivate
ifwinnotactive

etc... and they probably still say MyTheatre, just change it to whatever the 'title' of the window is for your program, i.e. Mozilla Firefox, Microsoft Word, Notepad, or probably BeyondTV for you.

What's happening is it's waiting for MyTheater to be active for 5 seconds, timing out, trying again, timing out, etc.. etc... then giving up.


=====

Finally, for anyone wanting to use this I've a small update I wrote just now (as I'm having to redo my whole setup). Since Aeon now has the wonderful 'add main menu item' option that reads from 'favourites.xml' here's the entry:

Code:
<favourites>
<favourite name="HyperSpin">XBMC.RunScript(C:\program files\XBMC\launcher.py)</favourite>
</favourites>

This is WAY easier than hacking through theme code and butchering it!

I'll try to poke around this thread more often- if anyone has any questions feel free to PM me, or if you have questions hit me up over at http://hyperspin-fe.com [SophT]
Reply
#20
Hello,

I stumbled into this thread when looking for information about Minimizing XBMC.
I know there can be a hotkey assigned to Minimize and I did so

But I wonder something and hopefully someone can help me out.
I want something like this in Windows:

- Lauch XBMC
- Launch another application + run hotkey combination

In XBMC:
- On minimize or on keypress (depending on what kind of behaviour are supported), run hotkey combination

Outside XBMC, which is now minimized
- On Maximize, run hotkey combination.


With "run hotkey combination", I mean that the script/tool simulates a key-combination-press.

Is this something that can be done with your technique? Please lead me to the right direction.

Background info:
1. I got help with a system that starts directly with XBMC (My children will use this computer and they cant handle something more complicated than a remote).
2. XBMC is started through a launcher software which starts XBMC and another tool.
3. That other tool can be hidden through CTRL-ALT-R but unfortunately it isnt hidden on start - I want to hide it.
4. When minimizing XBMC using a button on a remote controller, I want "something" to listen to this and trigger a hotkey. I understand that AutoHotkey can be triggered to listen to hotkeys (like minimize-hotkey). But can it also "send" a hotkey, eg CTRL-ALT-R?
5. Men maximizing XBMC again, I need "something" to notice that and send the hotkey CTRL-ALT-R.



So I need it to
Reply
#21
First, I just want to say that this is a great mod, very good idea.

Next, I wanted to ask if anyone is using this method to launch Boxee? I like Boxee for its huge array of online content, but the way it handles local media is not to my liking. I figured this would be the best of both worlds.

I've gotten it to work up to the point where it actually launches Boxee, but for some reason, whenever I launch it from within XBMC I get an error from Boxee stating "No Suitable Skin version found, we require at least 2.1000" or something very similar.

I think that I need to increase the time between when XBMC closes and Boxee launches but I can't seem to find the right value to modify in order to make that happen. Changing the WinWait and WinWaitActivate values doesn't seem to have any effect on this part of the process. Can anyone point me in the right direction.

Thanks in advance...
Reply
#22
I think I am on the right track to solve this, thanks to the program Autohotkey.
A classmate of mine at the university has more programmer brain than I do and the solution is near.

Autohotkey can tell if a program is not focused (and I think minimized) and bring it to the front again.
That means I can now program my remote control to bring forth XBMC if minimized or if it does not even exist then launch.
Super-solution, so my kids just need to press one key and voila, XBMC is there.

SophT: Can you run AHK files without running Autohotkey in the background? I dont want to run any additional software if possible.

Josefin Wrote:Hello,

I stumbled into this thread when looking for information about Minimizing XBMC.
I know there can be a hotkey assigned to Minimize and I did so

But I wonder something and hopefully someone can help me out.
I want something like this in Windows:

- Lauch XBMC
- Launch another application + run hotkey combination

In XBMC:
- On minimize or on keypress (depending on what kind of behaviour are supported), run hotkey combination

Outside XBMC, which is now minimized
- On Maximize, run hotkey combination.


With "run hotkey combination", I mean that the script/tool simulates a key-combination-press.

Is this something that can be done with your technique? Please lead me to the right direction.

Background info:
1. I got help with a system that starts directly with XBMC (My children will use this computer and they cant handle something more complicated than a remote).
2. XBMC is started through a launcher software which starts XBMC and another tool.
3. That other tool can be hidden through CTRL-ALT-R but unfortunately it isnt hidden on start - I want to hide it.
4. When minimizing XBMC using a button on a remote controller, I want "something" to listen to this and trigger a hotkey. I understand that AutoHotkey can be triggered to listen to hotkeys (like minimize-hotkey). But can it also "send" a hotkey, eg CTRL-ALT-R?
5. Men maximizing XBMC again, I need "something" to notice that and send the hotkey CTRL-ALT-R.



So I need it to
Reply
#23
Quote:I've gotten it to work up to the point where it actually launches Boxee, but for some reason, whenever I launch it from within XBMC I get an error from Boxee stating "No Suitable Skin version found, we require at least 2.1000" or something very similar.

With Boxee alpha, I was never able to get it to launch. it was weird, have XBMC launch a wrapper and have the wrapper open boxee, error. double click the wrapper in Windows, launch boxee, it works.

I haven't tried with the latest beta though, maybe I'll get a chance to do that soon.



Quote:SophT: Can you run AHK files without running Autohotkey in the background? I dont want to run any additional software if possible.

well, the short answer is no. You'll have to have the application running for it to 'watch' for your hotkeys. But a compiled AHK file (exe) requires very little resources to run. I'm glad you figured out a solution for your setup.
Reply
#24
Thank you SophT, the compiler was hidden in the Autohotkey folder.
Reply
#25
Hey everyone,

I'm using the ShowMix theme- a customized one based off Aeon. For this mod, I don't see to have the 'Include_mainmenu.xml' file anywhere in my skin/1080i/ folder.

Can someone help? Or show to me where the file is on this theme version??

Thanks!
Reply
#26
well i sort of figured out a way around my issue.
placed my launcher.py in my scripts subfolder and added it to my favourites, renamed it to what i want and added it to my main menu on the home screen! works perfectly. Hope others find this way useful!
Reply
#27
I would like to be able to launch a program like hyperspin from xbmc. I have tried everything listed here and also using the launcher, but I can not get anything to work. I am using aeon skin with showmix 2.55. I know there must be a way to do this but I might need a basic method or a step by step guide. Any help would be great.
Reply
#28
Works great for me, I just had to remove the -p from the XLauncher script.

Thanks a lot for the guide, and thanks to whoever it was that pointed out that AHK is AutoHotKey script Smile
Reply
#29
I've got posts on these threads that are related to this request:

1) http://forum.xbmc.org/showthread.php?tid=83261

2) http://forum.xbmc.org/showthread.php?tid=82743

The BoxeeLauncher fixes the error noted earlier in this thread so works great but I really want to have the smooth transitions of the Black screen ("the dark curtain") in between. And as I noted in the other posts - I think I need to close out XBMC when switching to Boxee to avoid hogging resources as well as the issue of one of these programs responding to the remote even when not the focus (forget which one, but one of the 2 never stops listening)

So what's described in Post #4 sounds like the way to go except I would need 2 versions - Hulu Desktop & Boxee. Probably a really stupid question but for somebody who is quite comfortable hacking away at stuff but NOT a programmer (and no programs at my disposal to compile anything) - how do I go about compiling my own versions?

I'm using a REVO as my dedicated HTPC - it has 4 GB RAM and the 330 processor so would need to check how bogged down it gets with Hulu Desktop & XBMC running - those 2 play nice as I recall so perhaps could leave Hulu Desktop running all the time?

Any & all assistance greatly appreciated!
Reply
#30
ok, been reading and hacking at this...

Figured out hot to compile the AHK script for Launching Hulu (Post#4) into an EXE. I then used Launcher to run it...it works - started Hulu desktop, Closed XBMC and when I exited Hulu Desktop it restarted XBMC.

But the transition wasn't pleasant...XBMC window minmizing before closing, could see my desktop for a while...not the nice black transition screen written into the AHK script. So took the updated info from Post #19 in this thread and added a Favourite to call a Python script - that would run the HuluLauncher.exe file.

That worked GREAT!! Nice/smooth transition to Hulu...but (and a big one) - when I exit Hulu desktop I get this error window (see below) and XBMC does NOT restart. No idea what this means or how to resolve.

Image

Since the AHK compiled script worked when I started it from Launcher - pretty sure it's ok...so what am I missing that's causing it to error when I exit HuluDesktop?

This is my favourites file:
Code:
<favourites>
  <favourite name="Hulu">XBMC.RunScript(C:\Users\SR\AppData\Roaming\XBMC-BOXEE\HuluLauncher.py)</favourite>    
  <favourite name="Boxee">XBMC.RunScript(C:\Users\SR\AppData\Roaming\XBMC-BOXEE\BoxeeLauncher.py)</favourite>    
</favourites>

Here's my python script to call the AHK compiled HuluLauncher (refer to Post#4 in this thread)
Code:
import os, subprocess

subprocess.Popen(["C:\Users\SR\AppData\Roaming\XBMC-BOXEE\HuluLauncher.exe"], shell=False)

Let me know if I need to supply any other info...I'm scratching my head here...

-------------------
Also - I would like to do the same for Boxee - I started using this BoxeeLauncher program from this post: http://forum.xbmc.org/showthread.php?tid=82743 - but it leaves XBMC running and I need to close XBMC when switching to Boxee - also - the transition screens are messy with the BoxeeLauncher as is - so would like to incorporate the smooth/black screen transitions in the AHK script.

But since starting Boxee this way apparently requires the username/password for the Windows user to be passed in the launcher program - no idea how to include that in a revised AHK script for Boxee?

Hoping someone can assist me over these speedbumps...thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
[MOD] Program Launcher Hack0