Sign in to follow this  
Followers 0
Baraoic

HotKeys With Windows 7

1 post in this topic

Ok so I have a hotkey script I use which is

HotKeySet("^!n", "Notepad")
HotKeySet("^!c", "Calc")
HotKeySet("^!a", "AutoItHelp")
HotKeySet("{MEDIA_PLAY_PAUSE}", "MediaPause")
HotKeySet("^{MEDIA_PLAY_PAUSE}", "MainPlayList")
HotKeySet("!{MEDIA_PLAY_PAUSE}", "NewlyAddedPlayList")
HotKeySet("{MEDIA_NEXT}", "MediaNext")

$oiTunes = ObjCreate("iTunes.Application")

While 1
    Sleep(1000)
WEnd

Func Notepad()
    If WinExists("Untitled - Notepad") Then
        WinActivate("Untitled - Notepad")
    Else
        Run("notepad.exe")
    EndIf
EndFunc ;==>Notepad

Func Calc()
    If WinExists("Calculator") Then
        WinActivate("Calculator")
    Else
        Run(@SystemDir & "\calc.exe")
    EndIf
EndFunc ;==>Calc

Func AutoItHelp()
    If FileExists(@ProgramFilesDir & "\AutoIt3\AutoIt.chm") Then
        ShellExecute(@ProgramFilesDir & "\AutoIt3\AutoIt.chm")
    ElseIf FileExists(@HomeDrive & "\Program Files (x86)\AutoIt3\AutoIt.chm") Then
        ShellExecute(@HomeDrive & "\Program Files (x86)\AutoIt3\AutoIt.chm")
    Else
        MsgBox(0, "Error", "Can't Find AutoIt Installation Directory")
    EndIf
EndFunc ;==>AutoItHelp

Func MediaPause()
    If ProcessExists("iTunes.exe") Then
        $oiTunes.PlayPause
    EndIf
EndFunc ;==>MediaPause

Func MainPlayList()
    If ProcessExists("iTunes.exe") Then
        For $TempPlaylist In $oiTunes.LibrarySource.Playlists
            If $TempPlaylist.Name = "Main" Then
                $TempPlaylist.PlayFirstTrack
            EndIf
        Next
    EndIf
EndFunc ;==>MainPlayList

Func NewlyAddedPlayList()
    If ProcessExists("iTunes.exe") Then
        For $TempPlaylist In $oiTunes.LibrarySource.Playlists
            If $TempPlaylist.Name = "Newly Added" Then
                $TempPlaylist.PlayFirstTrack
            EndIf
        Next
    EndIf
EndFunc ;==>NewlyAddedPlayList


Func MediaNext()
    If ProcessExists("iTunes.exe") Then
        $oiTunes.NextTrack
    EndIf
EndFunc ;==>MediaNext

and I noticed something eairler when testing something. If I run a game as administrator the itunes hotkeys will not work while the game is the current focus. I forgot to test my other hotkeys to see if its an itunes only thing. Also I did notice this once when I was installing a program as administrator. Anybody have any idea why this would happen?

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