Sign in to follow this  
Followers 0
assi4

Need a command to check if HDMI is connected or not

1 post in this topic

Hi,

This is my first script, so just bare with me :mellow:

What I want to do is to switch screens in dual view when running the script, but only if the HDMI cable is connected. So what I need basically is a value or something to check against for an if-sentence, so that it will only try to change if it is connected.

My script is as follows:

Send("#r")

WinWaitActive("Kjør")

Send("desk.cpl{ENTER}")

WinWaitActive("Skjerminnstillinger")

Send("2")

Send("!u")

Send("!o")

Send("{END}")

Send("!d")

Send("1")

Send("!u")

Send("b")

WinWaitActive("Skjerminnstillinger")

Send("j")

WinWaitActive("Skjerminnstillinger")

Send("{ENTER}")

WinWaitClose("Skjerminnstillinger")

Send("#r")

WinWaitActive("Kjør")

Send("mmsys.cpl{ENTER}")

WinWaitActive("Lyd")

Send("{DOWN}")

Send("{DOWN}")

Send("{DOWN}")

Send("!s")

WinClose("Lyd")

WinWaitClose("Lyd")

Run("C:\Program Files\XBMC\XBMC.exe -fs -p")

WinWaitActive("XBMC Media Center")

WinWaitClose("XBMC Media Center")

Send("#r")

WinWaitActive("Kjør")

Send("desk.cpl{ENTER}")

WinWaitActive("Skjerminnstillinger")

Send("1")

Send("!u")

Send("!o")

Send("{END}")

Send("!d")

Send("2")

Send("!u")

Send("b")

WinWaitActive("Skjerminnstillinger")

Send("j")

WinWaitActive("Skjerminnstillinger")

Send("{ENTER}")

WinWaitClose("Skjerminnstillinger")

Send("#r")

WinWaitActive("Kjør")

Send("mmsys.cpl{ENTER}")

WinWaitActive("Lyd")

Send("{DOWN}")

Send("{DOWN}")

Send("!s")

WinClose("Lyd")

Here the sound is switched to HDMI, and the display is switched to the 2nd screen and the resolution is set to max. After that it opens XBMC, and reverses the process when it is closed.

The problem is that if this is run without the HDMI connected, it won't do any good. So I'd like to just open XBMC directly if it isn't connected (The script is assigned to the Media Direct button on a XPS M1530 laptop).

Does anyone have a command for this, or know any way to detect if the HDMI is connected or not?

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0