litlmike Posted March 31, 2006 Share Posted March 31, 2006 Quick one here. Can't seem to assign a HotKey to WinActivate the Scite window. Can you help me? Below is the window info, and below that is the code: Title: C:\Documents and Settings\[My Name]\My Documents\Personal\AutoIt\Script - Tasks.au3 - SciTE [5 of 7] Class: SciTEWindow expandcollapse popup#include <IE.au3> #include <Date.au3> #include <GUIConstants.au3> Global $Paused, $cat_1, $date_a, $email, $contact, $company, $email, $title HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("^q", "Activate_ACT") HotKeySet("^w", "Activate_Eudora") HotKeySet("^e", "Activate_Scite") ;;;;;;;; Body of program would go here;;;;;;;; While 1 Sleep(100) WEnd ;;;;;;;; ; Pause and Escape Functions Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc ;******************************************************************************** Func Activate_ACT() $title = WinGetTitle("") WinWait("ACT!","") If Not WinActive("ACT!","") Then WinActivate("ACT!","") WinWaitActive("ACT!","") Return EndFunc Func Activate_Eudora() $title = WinGetTitle("") WinWait("Eudora","") If Not WinActive("Eudora","") Then WinActivate("Eudora","") WinWaitActive("Eudora","") EndFunc Func Activate_Scite () $title = WinGetTitle("") $scite_window_title = "classname=SciTEWindow" WinWait($scite_window_title,"") If Not WinActive($scite_window_title,"") Then WinActivate($scite_window_title,"") WinWaitActive($scite_window_title,"") EndFunc _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
seandisanti Posted March 31, 2006 Share Posted March 31, 2006 Quick one here. Can't seem to assign a HotKey to WinActivate the Scite window. Can you help me? Below is the window info, and below that is the code: expandcollapse popup#include <IE.au3> #include <Date.au3> #include <GUIConstants.au3> Global $Paused, $cat_1, $date_a, $email, $contact, $company, $email, $title HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("^q", "Activate_ACT") HotKeySet("^w", "Activate_Eudora") HotKeySet("^e", "Activate_Scite") ;;;;;;;; Body of program would go here;;;;;;;; While 1 Sleep(100) WEnd ;;;;;;;; ; Pause and Escape Functions Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc ;******************************************************************************** Func Activate_ACT() $title = WinGetTitle("") WinWait("ACT!","") If Not WinActive("ACT!","") Then WinActivate("ACT!","") WinWaitActive("ACT!","") Return EndFunc Func Activate_Eudora() $title = WinGetTitle("") WinWait("Eudora","") If Not WinActive("Eudora","") Then WinActivate("Eudora","") WinWaitActive("Eudora","") EndFunc Func Activate_Scite () $title = WinGetTitle("") $scite_window_title = "classname=SciTEWindow" WinWait($scite_window_title,"") If Not WinActive($scite_window_title,"") Then WinActivate($scite_window_title,"") WinWaitActive($scite_window_title,"") EndFuncthis works for me... Opt("WinTitleMatchMode",4) HotKeySet("{F1}","SciteForMe") While 1 Sleep(100) WEnd Func SciteForMe() WinActivate("classname=SciTEWindow") EndFunc Link to comment Share on other sites More sharing options...
litlmike Posted March 31, 2006 Author Share Posted March 31, 2006 this works for me... Opt("WinTitleMatchMode",4) HotKeySet("{F1}","SciteForMe") While 1 Sleep(100) WEnd Func SciteForMe() WinActivate("classname=SciTEWindow") EndFunc As always, you are very helpful. Thanks. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
seandisanti Posted March 31, 2006 Share Posted March 31, 2006 As always, you are very helpful. Thanks.no problem, i'm glad to help. the way i did it is definitely not the only way, you can also do it by using window title, text, etc. if you look up the option WinTitleMatchMode you'll see all of the different ways that you can identify any given window for activation or interaction. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now