AutoHotKey
AutoHotkey is a free, open source macro creation and automation software utility. It can be used to automate repetitive tasks and even create custom programs. In this section you'll find little bits of code that you can analyze or use. This is just novice stuff as I take a stab at learning a little programming so your best bet to learn or ask questions is the very busy user forums at the Autohotkey website.
These first examples show 3 different ways to launch FileZilla - just getting my feet wet here so not rocket science.
;******************************************************
; Launch FileZilla / Example 1
;
; Description: This example runs FileZilla then sends
; the key stroke shortcuts (ie CTRL+S) to select the
; various options.
;
; In this example I know that I want the third site
; in the tree view so I sent {PgUp} after launching
; the Site Manager to go to the top of the list
; then I send the {Down} arrow command three times.
;
; In this example you also see the use of a simple sub
; called using GoSub.
;******************************************************
#NoEnv
SendMode Input
SetTitleMatchMode, 2
SetTitleMatchMode Slow ; used this command as sometimes
; the search for the Window title
; failed because things were
; happening to fast.
;******************************************************
IfWinExist FileZilla
{
WinActivate
Gosub, subSendKeystrokes
Exit
}
else
{
Run %A_ProgramFiles%\FileZilla FTP Client\filezilla.exe
WinWait FileZilla
WinActivate FileZilla
Gosub, subSendKeystrokes
Exit
}
;*******************SUBROUTINES ***********************
subSendKeystrokes:
Send ^s
SendInput {PgUp}
Loop 3
{
SendInput {Down}
}
Send !c
return
;******************************************************
;******************************************************
; Launch FileZilla / Example 2
;
; Description: This example uses simple link with
; parameters from the FileZilla wiki to launch FZ
; with the user site value in %SelectSite%
;******************************************************
#NoEnv
SendMode Input
SetTitleMatchMode, 2
SetTitleMatchMode Slow
;******************************************************
SelectSite := "MySite"
;******************************************************
IfWinExist FileZilla
{
WinActivate
Exit
}
else
{
Run %A_ProgramFiles%\FileZilla FTP Client\filezilla.exe -c 0/%SelectSite%
WinWait FileZilla
WinActivate FileZilla
Exit
}
;******************************************************
;******************************************************
; Launch FileZilla / Example 3
;
; Description: This example uses ControlGetFocus to
; select the Tree View control in FileZilla Site
; Manager and navigate to the Tree View option
; whose name matches the value in variable %SelectSite%
;******************************************************
#NoEnv
SendMode Input
SetTitleMatchMode, 2
SetTitleMatchMode Slow
;******************************************************
SelectSite := "MySite" ;exact name of site in tree view
;******************************************************
IfWinExist FileZilla
{
WinActivate
Exit
}
else
{
Run %A_ProgramFiles%\FileZilla FTP Client\filezilla.exe
WinWait FileZilla
WinActivate FileZilla
Send ^s
ControlGetFocus, OutputVar, ahk_class SysTreeView321, %SelectSite%
Send !c
Exit
}
;******************************************************