This thread is outdated - GO TO THE v3 BETA THREAD INSTEAD
This thread is outdated - GO TO THE v3 BETA THREAD INSTEAD
This thread is outdated - GO TO THE v3 BETA THREAD INSTEAD
Well, after a LONG inactivity period (2 years!) I'm sort of back!
The first thing I want to tell the AHK community is that I'm making a new version of SciTE4AutoHotkey.
NEW: Alpha 1 testing has begun. Scroll to the end of the post for more info.
NEW: Toolbar finished. Scroll a bit down to see and download it.
NEW: BETA RELEASE ADDED!
NEW: Beta updated with bugfixes and installer added.
NEW: Added counters courtesy of Titan and release date.
Number of downloads that the beta installer has had this month:
Number of downloads that the beta zip has had this month:
SciTE4AutoHotkey v2 Stable will be released on
March 1, 2009.
BETA BETA BETA BETA BETA ARGHH!!
Scroll down to download the beta!
NEW: Webpage
Here is a screenie (yes I switched from XP to Vista!):
Here is a list of things to hopefully come:
- (done) Different style for syntax highlighting, it will be more readable.
- (done) A new sort of toolbar which will provide access to a set of different tools for AutoHotkey scripting.
- (done, I think) Fixed and improved ports of tools for AHK scripting, because the current ports of the tools are a bit hack-ish.
- (done) This will use the newest SciTE and Scintilla versions. The provided Scintilla version will only have support for AutoHotkey (only the AHK lexer will be present in conjuction with the lexer for error lists), that will make the DLL much smaller.
- (web installer done) (Installer) There will be an offline installer and a web installer (download packages from autohotkey.net then install them, like Microsoft does).
- A version specially designed for inclusion within the AutoHotkey package.
- (done, I think) Integrated autohotkey.net support.
- (done) Code fold on open will be turned off by default, I had a lot of posts saying it was annoying.
- (done) Fix calltips that were disappearing when they weren't supposed to.
Toolbar support
The toolbar I think it's done. I've revamped the toolbar so that it's nicer.
Screenshot:
For existing SciTE4AutoHotkey v2 Alpha 1 users: Unpack the following .zip file into the SciTE folder (it replaces files):
http://www.autohotkey.net/~fincs/SciTE4AutoHotkey_2/newtoolbar1.zip
autohotkey.net support
SciTE4AutoHotkey will come with integrated autohotkey.net support.
That means you will be able to upload your scripts with the ease of
a simple application that will read your script looking for special lines that will tell the tool what files to upload, where, etc.
The application will ask you and store (if you want) your username and password in a settings file. As privacity is a very important thing, the password will be encrypted, and for security reasons the encryption part of the script will not be publicly available, because a clever hacker could create a trojan that could steal your password.
Anyway, the syntax for those commands is (semicolon included):
Code:
;#AHKNet_CommandName parameter
or
Code:
;#AHKNet_CommandName "param1" "param2" "param3" ...
The current commands are:
UploadScript
path/to/remote/script.ahkIt uploads the script (the script where the commands are) to the specified path and filename. The filename is
NOT optional (maybe in future releases) while the path is.
It also checks that every specified path is present, if any of them isn't present it creates it.
UploadFile "
path\to\local\script.ahk" "
path/to/remote/script.ahk"
It uploads the specified file (relative to the directory where the script containing the commands is or absolute path) to the specified path and filename. The filename is
NOT optional (maybe in future releases) while the path is.
It also checks that every specified path is present, if any of them isn't present it creates it.
Note: Quotes
MUST be present.
ChangeDirectory
directoryWorks like a regular MS-DOS cd, the only change is that you use / instead of \.
This
DOESN'T have directory checking so make sure the directory exists or else the tool will give you an error (use UploadScript or UploadFile before).
Example (uploads the script and its dependencies):
Code:
; Upload this script to myScripts/someScript
;#AHKNet_UploadScript myScripts/someScript/main.ahk
; Go to myScripts/someScript. Directory checking takes a lot of time
; so it's better to check only once (UploadScript), go there and upload
; the files without specifying the path.
;#AHKNet_ChangeDirectory myScripts/ahknetutil
; Upload the dependencies
;#AHKNet_UploadFile "dependency1.ahk" "dependency1.ahk"
;#AHKNet_UploadFile "dependency2.ahk" "dependency2.ahk"
;#AHKNet_UploadFile "dependency3.ahk" "dependency3.ahk"
OK, here is the link to the tool, it's a compiled AHK file (source coming soon):
DownloadOh, I forgot to say: It also detects a SciTE window and uses the text from it and the filename in the title bar.
NEW: Source (warning! It contains lots of unused stuff)
ahknetutil.ahk (colorful html version
here, that demonstrates the new style)
Code:
#NoTrayIcon
#Include ftp.ahk
#NoEnv
#SingleInstance Force
SetWorkingDir, %A_ScriptDir%
DetectHiddenWindows, On
#Include toolbarmessages.ahk
#Include remotebuffer.ahk
#Include crypt.ahk ; contains crypting and decrypting routines
; I can't share that script because of security issues
; The only thing I can tell you is the function definitions:
; InitCrypt() (initializes the encryption system)
; CryptData(data) (compresses data to a 512-byte long hex stream)
; DecryptData(data) (decrypts a 512-byte long hex stream to the plain text)
; Command data
_CommandList = ChangeDirectory,UploadScript,UploadFile
_Command_ChangeDirectory_NParams = 1
_Command_UploadScript_NParams = 1
_Command_UploadFile_NParams = 2
hasSciTE := false
hasToolbar := false
InFile := ""
InitCrypt()
; Find a SciTE window.
IfWinExist, ahk_class SciTEWindow
{
hasSciTE := true
SciTE_HWND := WinExist()
WinGetTitle, TempVar, ahk_id %SciTE_HWND%
If(!RegExMatch(TempVar, "^(.+?) ([-*]) SciTE", Tempy)){
MsgBox Bad SciTE window!
ExitApp
}else{
InFile = %Tempy1%
InFile_IsScratch := Tempy2 = "*" ? true : false
InFile_IsUntitled := false
IfNotExist, %InFile%
InFile_IsUntitled := true ; probabily an Untitled window
ControlGet, Scintilla_HWND, HWND,, Scintilla1, ahk_id %SciTE_HWND%
Gosub, ConfigWorkingDir
}
}
IfWinExist, AHKToolbar4SciTE ahk_class AutoHotkeyGUI
{
hasToolbar := true
Toolbar_HWND := WinExist()
}
If hasSciTE
alltext := ScintillaGetText(Scintilla_HWND)
Else
Goto, SettingsGUI
Goto, LoginAHKNet
;----------------
LoginAHKNet:
Gui, Add, Text, x12 y12 w170 h20, Login in autohotkey.net
Gui, Add, Text, x12 y32 w60 h20, Username:
Gui, Add, Edit, x82 y32 w100 h20 vAHKNetUser
Gui, Add, Text, x12 y52 w60 h20, Password:
Gui, Add, Edit, x82 y52 w100 h20 +Password Limit128 vAHKNetPassword
Gui, Add, Button, x12 y112 w60 h20 gAHKNetExecute, Execute
Gui, Add, Button, x82 y112 w40 h20 gExit, Exit
Gui, Add, Button, x132 y112 w50 h20 gSettingsGUIOpenFromLogin, Settings
Gui, Add, CheckBox, x12 y82 w170 h20 Checked vAHKNetRemember, Remember me
Gui, Show, w196 h145, autohotkey.net Utility
Gosub, ReadAndShowRecordedData
Return
AHKNetExecute:
Gui, Submit
If AHKNetRemember
{
IniWrite, %AHKNetUser%, ahknet.ini, LoginData, User
IniWrite, % CryptData(AHKNetPassword), ahknet.ini, LoginData, Password
}
Gui, Destroy
; <--- Connect to autohotkey.net --->
LittleSplashOn("Connecting to`nautohotkey.net...")
hFTPConnection := FTP_Open("autohotkey.net", 21, AHKNetUser, AHKNetPassword)
If !hFTPConnection
{
LittleSplashOff()
MsgBox, 16, autohotkey.net Tool,
(LTrim
Failed to connect to autohotkey.net!
Possible causes:
· Your Internet connection may be inactive or wrongly set-up
· Bad username and/or password
· The autohotkey.net server may be down
)
ExitApp
}
; <--- Process the AHK script for FTP commands --->
ncmds = 0
Loop, Parse, alltext, `n, `r
{
cline = %A_LoopField%
If(SubStr(cline, 1, 9) == ";#AHKNet_"){
curcmd := SubStr(cline, 10)
If(!RegExMatch(curcmd, "^(.+?) (.+?)$", Tempy)){
MsgBox, 16, autohotkey.net Tool, Syntax error at line %A_Index%.
ExitApp
}
cmd = %Tempy1%
params = %Tempy2%
if cmd not in %_CommandList%
{
MsgBox, 16, autohotkey.net Tool, Invalid command at line %A_Index%.
ExitApp
}
If(!ParseParams("params", _Command_%cmd%_NParams)){
MsgBox, 16, autohotkey.net Tool, % "Too few parameters at line " A_Index ", should be " _Command_%cmd%_NParams "."
ExitApp
}
If(!ExecCmd(cmd, params1, params2, params3, params4)){
FTP_Close()
LittleSplashOff()
MsgBox, 16, autohotkey.net Tool, There was an error during the upload!`nCrashed at line number: %A_Index%`nError message:`n`n%LastError%
ExitApp
}
}
}
FTP_Close()
LittleSplashOff()
MsgBox, 64, autohotkey.net Tool, Upload succesful!
goto GUIClose
Return
SettingsGUI:
FileSelectFile, InFile, 1,, Select AHK file to process and upload, AHK scripts (*.ahk)
if InFile =
ExitApp
IfNotExist, %InFile%
{
MsgBox, 16, autohotkey.net Tool, File does not exist.
ExitApp
}
Gosub, ConfigWorkingDir
FileRead, alltext, %InFile%
goto LoginAHKNet
return
ConfigWorkingDir:
SplitPath, InFile,, __Dir
SetWorkingDir, %__Dir%
Return
SettingsGUIOpenFromLogin:
MsgBox, 64, autohotkey.net Tool, Sorry`, settings GUI is currently not available. [*EXITAPP ACTION*]
GUIClose:
Exit:
ExitApp
ReadAndShowRecordedData:
IniRead, usr, ahknet.ini, LoginData, User, %A_Space%
IniRead, pwd, ahknet.ini, LoginData, Password, %A_Space%
; decrypt the password
If(StrLen(pwd) >= 512)
pwd := DecryptData(pwd)
Else
pwd =
GuiControl,, AHKNetUser, % usr
GuiControl,, AHKNetPassword, % pwd
pwd = ; security reasons
Return
LittleSplashOn(t){
Global LS_Text
Gui 99:Add, Text, vLS_Text w300 h225 +Border, % t
Gui 99:-Caption +ToolWindow +AlwaysOnTop +Border
Gui 99:Show, NoActivate
}
LittleSplashText(t){
GuiControl 99:, LS_Text, % t
}
LittleSplashOff(){
Gui 99:Destroy
}
;SendMessageUser32(hwnd, msg, wParam=0, lParam=0, type1="int", type2="int"){
; Return DllCall("SendMessageA", "UInt", hwnd, "int", msg, type1, wParam, type2, lParam)
;}
ScintillaGetLength(hwnd){
Global SCI_GETLENGTH
SendMessage, SCI_GETLENGTH, 0, 0,, ahk_id %hwnd%
Return ErrorLevel+1
}
ScintillaGetText(hwnd){
Global SCI_GETLENGTH, SCI_GETTEXT
SendMessage, SCI_GETLENGTH, 0, 0,, ahk_id %hwnd%
length := ErrorLevel
RemoteBuf_Open(hSBuf, hwnd, length + 2)
SendMessage, SCI_GETTEXT, length + 1, RemoteBuf_Get(hSBuf),, ahk_id %hwnd%
VarSetCapacity(sText, length + 2)
RemoteBuf_Read(hSBuf, sText, length + 2)
RemoteBuf_Close(hSBuf)
Return sText
}
ScintillaSetText(hwnd, txt){
Global SCI_SETTEXT
length := StrLen(txt)+1
RemoteBuf_Open(hSBuf, hwnd, length)
RemoteBuf_Write(hSBuf, txt, length)
SendMessage, SCI_SETTEXT, 0, RemoteBuf_Get(hSBuf),, ahk_id %hwnd%
RemoteBuf_Close(hSBuf)
}
ParseParams(outVar, nParams){
Global
Local plist, pattern
plist := %outVar%
if nParams = 0
Return true
if nParams = 1
{
%outVar%1 := plist
Return true
}
pattern =
Loop, %nParams%
pattern .= "\s*\x22(.+?)\x22"
Return RegExMatch(plist, pattern, %outVar%) != 0
}
ExecCmd(cmd, param1="", param2="", param3="", param4=""){
Global hFTPConnection, InFile, LastError
If cmd = ChangeDirectory
{
LittleSplashText("Going to`n" param1 "...")
LastError = Couldn't go to "%param1%"!
Return FTP_SetCurrentDirectory(hFTPConnection, param1)
}Else If cmd = UploadScript
{
LittleSplashText("Uploading the script to`n" param1 "...")
; Run the prologue for file uploading
If(!_CMDHelper_UploadPrologue(hFTPConnection, param1))
Return false
; Upload the script.
Return _CMDHelper_Upload(hFTPConnection, InFile, param1)
}Else If cmd = UploadFile
{
LittleSplashText("Uploading file:`n" param1 "`nto:`n" param2 "...")
; Run the prologue for file uploading
If(!_CMDHelper_UploadPrologue(hFTPConnection, param2))
Return false
; Upload the script.
Return _CMDHelper_Upload(hFTPConnection, param1, param2)
}Else
Return false
}
_CMDHelper_UploadPrologue(hFTPConnection, path){
Global LastError
; First parse it into a series of directories.
StringSplit, DirArray, path, /
If DirArray0 != 0
{
dirname =
Loop, % DirArray0 - 1
{
dirname .= DirArray%A_Index% "/"
; The classic cd test
if(!FTP_GetCurrentDirectory(hFTPConnection, TempDir)){
LastError = Couldn't get current directory!
Return false
}
if(!FTP_SetCurrentDirectory(hFTPConnection, SubStr(dirname, 1, StrLen(dirname)-1))){
if(!FTP_CreateDirectory(hFTPConnection, SubStr(dirname, 1, StrLen(dirname)-1))){ ; ... so we create it.
LastError := "Couldn't create folder " SubStr(dirname, 1, StrLen(dirname)-1) "!"
Return false
}
}else{
; The test was succesful, but now we have to return to the directory
if(!FTP_SetCurrentDirectory(hFTPConnection, TempDir)){
LastError = Couldn't go to "%TempDir%"!
Return false
}
}
}
}
Return true
}
_CMDHelper_Upload(hFTPConnection, from, to){
Global LastError
; Check the existance of the file
if(FTP_GetFileSize(hFTPConnection, to, 2) != -1){
if(!FTP_DeleteFile(hFTPConnection, to)){
LastError = Couldn't delete file %to%!
Return false
}
}
; Upload the file.
LastError = Couldn't upload "%from%" to "%to%"!
Return FTP_PutFile(hFTPConnection, from, to, 2)
}
FTP_GetCurrentDirectory(hConnect,ByRef DirName){
VarSetCapacity(DirName, 256)
VarSetCapacity(MaxDirN, 4)
NumPut(256, MaxDirN)
r := DllCall("wininet\FtpGetCurrentDirectoryA", "uint", hConnect, "str", DirName, "str", MaxDirN)
If (ErrorLevel or !r)
Return 0
If(NumGet(MaxDirN) > 256){
VarSetCapacity(DirName, NumGet(MaxDirN))
r := DllCall("wininet\FtpGetCurrentDirectoryA", "uint", hConnect, "str", DirName, "str", MaxDirN)
}
If (ErrorLevel or !r)
Return 0
Else
Return 1
}
[linkneutralizer]ftp.ahk (not made by me,
download link)
toolbarmessages.ahk
Code:
WM_USER := 0x400
TBM_SELECTTOOL := 0x1
TBM_LAUNCHTOOL := 0x2
TBM_CLOSEALL := 0x3
; Scintilla messages
SCI_GETLENGTH := 2006
SCI_SETTEXT := 2181
SCI_GETTEXT := 2182
remotebuffer.ahk (not made by me,
link)
I can't share the file crypt.ahk because of what I said before.
BETA RELEASE TESTING PROGRAM
(NEW BUGFIXED BETA - IF YOU PREVIOUSLY DOWNLOADED THE BETA REDOWNLOAD IT)
After the Alpha 1, here comes the
beta!
Download link!:
http://www.autohotkey.net/fincs/SciTE4AutoHotkey_2/beta.zip
For those who prefer the PSPad syntax highlighting style and use the zip: Rename the file ahk.style.pspad.properties to ahk.style.properties.
Don't forget to read the readme.txt file!
Here is an installer for lazy people:
http://www.autohotkey.net/fincs/SciTE4AutoHotkey_2/betainstaller.exe
Compile_AHK II is bundled with the installer version (I hope the author doesn't care

).
EDIT: Basic toolbar support added.
EDIT2: Added more pictures of the toolbar.
EDIT3: Added information on autohotkey.net support.
EDIT4: Added source.
EDIT5: Added Alpha 1.
EDIT6: Added PSPad color scheme.
EDIT7: Added new toolbar.
EDIT8: ADDED BETA!
EDIT9: Added installer and fixed some bugs in the beta too.
EDITA: Added webpage.
EDITB: Added counters and release date.
If you remember me notice that I've improved my English.