Skip to content

Instantly share code, notes, and snippets.

tmplinshi

Block or report user

Report or block tmplinshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View GetBitrate.ahk
GetBitrate(FileName) {
if !InStr(FileName, ":") {
FileName := A_WorkingDir "\" FileName
}
RegExMatch(FileName, "^(.*\\)(.*)$", m)
oShell := ComObjCreate("Shell.Application")
oFolder := oShell.Namespace(m1)
return oFolder.GetDetailsOf( oFolder.Parsename(m2), 28 )
}
View ArgsToObj.ahk
/*
ArgsToObj - Convert command line parameters to object
Example:
---------------------------------------------------------------------
Command line parameters:
-from gbk /to utf-8 /a /b --delete-top 2 --delete-end=5 in.txt out.txt
Return:
{
View ParseCmdline.ahk
/*
ParseCmdline - parse command line to object
Example:
cmdline = "a test.ahk" -from gbk /to utf-8 /a /b --delete-top 2 --delete-end=5 "in file.txt" out.txt
o := ParseCmdline(cmdline)
MsgBox, % obj_print(o)
Return:
{
@tmplinshi
tmplinshi / b64.ahk
Last active Apr 10, 2019
Base64 Encode/Decode support UTF-16-LE encoding. Ported from VBS code https://stackoverflow.com/a/40118072/1631371.
View b64.ahk
b64_encode(p*) {
return b64.encode(p*)
}
b64_decode(p*) {
return b64.decode(p*)
}
class b64
{
View StdoutToVar.ahk
; ----------------------------------------------------------------------------------------------------------------------
; Function .....: StdoutToVar_CreateProcess
; Description ..: Runs a command line program and returns its output.
; Parameters ...: sCmd - Commandline to execute.
; ..............: sEncoding - Encoding used by the target process. Look at StrGet() for possible values.
; ..............: sDir - Working directory.
; ..............: nExitCode - Process exit code, receive it as a byref parameter.
; Return .......: Command output as a string on success, empty string on error.
; AHK Version ..: AHK_L x32/64 Unicode/ANSI
; Author .......: Sean (http://goo.gl/o3VCO8), modified by nfl and by Cyruz
View Class_ListBox.ahk
; Works for DropDownList/ComboBox/ListBox
Class ListBox
{
__New(hwnd) {
; GuiControl, +AltSubmit, %hwnd%
this.hwnd := hwnd
}
Add(str) {
GuiControl,, % this.hwnd, %str%
View Class_Excel.ahk
/*
Functions:
CreateByArray(outputFile, arr)
CreateByHLV(outputFile, HLV, Obj_LV_Colors := "", IncludeLvHeader := false)
HLV - Listview hwnd
Obj_LV_Colors - Created by using 'New LV_Colors(HLV)'
ChangeLog:
v1.05 (2017-8-17) - Added "Column AutoFit"; Added .xls file support
v1.04 (2016-12-9) - 'IncludeLvHeader' option now doesn't need to change default listview
v1.03 (2016-12-9) - Added support for LV_Colors's AlternateRows/AlternateCols
View ExcelToArray.ahk
ExcelToArray(FileName, nSheet := 1)
{
return ExcelToArray.DoIt(FileName, nSheet)
}
class ExcelToArray
{
DoIt(FileName, nSheet := 1)
{
if !FileExist(FileName)
View AutoCADExample.ahk
#NoEnv
cad := ComObjActive("AutoCAD.Application")
; AddText
point := Point3d("789.72", "1500.45", "0.0")
textObj := cad.ActiveDocument.ModelSpace.AddText("AutoHotkey", point, 80.77)
textObj.Update
; AddLine
View TrayIcon.ahk
; ----------------------------------------------------------------------------------------------------------------------
; Name ..........: TrayIcon library
; Description ...: Provide some useful functions to deal with Tray icons.
; AHK Version ...: AHK_L 1.1.13.01 x32/64 Unicode
; Original Author: Sean (http://goo.gl/dh0xIX) (http://www.autohotkey.com/forum/viewtopic.php?t=17314)
; Update Author .: Cyruz (http://ciroprincipe.info) (http://ahkscript.org/boards/viewtopic.php?f=6&t=1229)
; Mod Author ....: Fanatic Guru
; License .......: WTFPL - http://www.wtfpl.net/txt/copying/
; Version Date...: 2014 - 01 - 16
; Note ..........: Many people have updated Sean's original work including me but Cyruz's version seemed the most straight
You can’t perform that action at this time.