Jump to content
Sign in to follow this  
litlmike

Scite Window Quick Question

Recommended Posts

litlmike

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
#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

Share this post


Link to post
Share on other sites
seandisanti

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:

#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
this works for me...

Opt("WinTitleMatchMode",4)
HotKeySet("{F1}","SciteForMe")
While 1
    Sleep(100)
WEnd
Func SciteForMe()
WinActivate("classname=SciTEWindow")
EndFunc

Share this post


Link to post
Share on other sites
litlmike

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.

Share this post


Link to post
Share on other sites
seandisanti

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.

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  

×