Showing posts with label AutoHotKey Scripts. Show all posts
Showing posts with label AutoHotKey Scripts. Show all posts

Saturday, December 29, 2012


Want to change your Default Sound/Audio device without removing your 3.5MM JACK from your laptop by a simple shortcut ???

Step1: First download & install Autohotkey (just 2Mb simple program) from the below link. 
(Autohotkey is a very famous simple tool to automate ur work in windows.)

Step2: Save the below script as a Change_Audio.ahk file then open the Change_Audio.ahk. 
When you press (Windows + Shift + A) keys in your computer, your computer's default audio is changed.

;*********************************************************************************
; Change your Default Sound/Audio device without removing your 3.5MM JACK from your laptop.

; Shortcut to switch the Defalut audio device.  Windows Key + Shift + A
#+a::
Run, mmsys.cpl
WinWait,Sound
ControlSend,SysListView321,{Down}
ControlGet, isEnabled, Enabled,,&Set Default
if(!isEnabled)
{
 ControlSend,SysListView321,{Down 2}
}
ControlClick,&Set Default
ControlClick,OK
WinWaitClose
SoundPlay, *-1
Return
;***************************************************************

Know more about AutoHotKey from the below link.
http://www.autohotkey.com/docs/Tutorial.htm
Want to Put your PC in Sleep mode by a simple shortcut ???
Step1: First download & install Autohotkey (just 2Mb simple program) from the below link. 
(Autohotkey is a very famous simple tool to automate ur work in windows.)

Step2: Save the below script as a sleep_PC.ahk file then open the sleep_pc.ahk. 
When you press Contorl + shift +f12 key in your computer, your computer is put to sleep instantly.
;****************************************************************************
^+F12::
        ES_SYSTEM_REQUIRED=0x00000001
        ES_DISPLAY_REQUIRED=0x00000002
        ES_USER_PRESENT=0x00000004
        ES_AWAYMODE_REQUIRED=0x00000040
        ES_CONTINUOUS=0x80000000
          
; ES_AWAYMODE_REQUIRED    Enables away mode. This value must be specified with ES_CONTINUOUS. 
; Away mode should be used only by media-recording and media-distribution applications that must perform critical background processing on desktop computers while the computer ;appears to be sleeping. See Remarks.

; Windows Server 2003 and Windows XP/2000:  ES_AWAYMODE_REQUIRED is not supported. 
; ES_CONTINUOUS: Informs the system that the state being set should remain in effect until the next call that uses ES_CONTINUOUS and one of the other state flags is cleared.
;       ES_DISPLAY_REQUIRED    Forces the display to be on by resetting the display idle timer.
;       ES_SYSTEM_REQUIRED    Forces the system to be in the working state by resetting the system idle timer.
; ES_USER_PRESENT This value is not supported. If ES_USER_PRESENT is combined with other esFlags values, the call will fail and none of the specified states will be set.
        
DllCall("SetThreadExecutionState", "Int", ES_CONTINUOUS + ES_SYSTEM_REQUIRED + ES_DISPLAY_REQUIRED)  ; avoid ES_USER_PRESENT ;Turn off previos call which might prevent Suspend
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)               ; SLEEP
Return
;****************************************************************************

More Interested in this topic ? Click below:
http://www.autohotkey.com/board/topic/88618-shortcut-to-sleep-neither-hibernate-nor-hybrid-sleep/

Know more about AutoHotKey from the below link.
http://www.autohotkey.com/docs/Tutorial.htm

Want to Turnoff Monitor & Lock PC at the same time by a simple shortcut ???

Want to Turnoff Monitor & Lock PC at the same time by a simple shortcut ???
Step1: First download & install Autohotkey (just 2Mb simple program) from the below link. 
(Autohotkey is a very famous simple tool to automate ur work in windows.)

Step2: Save the below script as a Turn_Off_Monitor&LockPC.ahk file then open the Turn_Off_Monitor&LockPC.ahk. 
When you press Alt + Pausebreak key in your computer, your computer monitor is turned off & your PC is locked instantly !!!

; Turn Off Monitor & Lock PC
!Pause::
Sleep, 1000
SendMessage,0x112,0xF170,2,,Program Manager
DllCall("LockWorkStation")
Return

Know more about AutoHotKey from the below link.
http://www.autohotkey.com/docs/Tutorial.htm

Turn off your monitor by a simple Shortcut of your choice...

Want to turn off your monitor by a simple Shortcut of your choice ??
Step1: First download & install Autohotkey (just 2Mb simple program) from the below link. 
(Autohotkey is a very famous simple tool to automate ur work in windows.)

Step2: Save the below script as a Turn_Off_Monitor.ahk file then open the Turn_Off_Monitor file. 
When you press shift + pausebreak key in your computer, your computer monitor is turned off instantly !!
;************************************
+Pause::
Sleep, 200
SendMessage,0x112,0xF170,2,,Program Manager
Return

PrintScreen::ExitApp
;************************************
Know more about AutoHotKey from the below link.

Start playing a Song from a full Movie file from the time you want to....

Do you have Full movie file, but want to just play the video songs in it just from specific time by a simple shortcut ???
Here is the solution:
Simple Autohotkey Script to Start playing a Song from a full Movie file:

Step1: First download & install Autohotkey (just 2Mb simple program) from the below link. 
(Autohotkey is a very famous simple tool to automate ur work in windows.)

Step2: Save the below script as a 4_Google_Google.ahk file then open the 4_Google_Google.ahk file. 
The VLC Player will start playing the file from 01:30:41(hh:mm:ss) & will pause at 01:36:56(hh:mm:ss) to play you google google panni parthen song from the thuppaki_2012.mkv. 
Like this you can create simple shortcuts to the songs, rather than editing the full movie file !!!
You can edit the first three lines of the script to adjust according to your need.

Script begins.
;*********************************************************************************
begintime=01:30:41
endtime  =01:36:56
F1="F:\Movies\Thuppakki (2012)-DVDRip\Thuppakki_2012.mkv"

setworkingdir, %a_scriptdir%
VLC         =%A_programfiles%\VideoLAN\VLC\vlc.exe
gosub,timecalc
INPUT   =--qt-start-minimized --play-and-pause --height=500 --width=700 --input-repeat=0 --start-time %begin% --stop-time %end% %F1%
run,%VLC% %INPUT%
return

timecalc:
 stringsplit,b,begintime,`:
 hours  :=(b1*60*60)
 minutes:=(b2*60)
 seconds:=(b3)
 begin  :=(hours+minutes+seconds)
 ;--
 stringsplit,e,endtime,`:
 hours2  :=(e1*60*60)
 minutes2:=(e2*60)
 seconds2:=(e3)
 end     :=(hours2+minutes2+seconds2)
return
;*********************************************************************************
Read more if you are interested on this topic:
http://www.autohotkey.com/board/topic/88149-play-a-offline-video-at-a-specific-timeline-in-a-offline-video-player/

Know more about AutoHotKey from the below link.