Search found 1187 matches

by tmplinshi
13 Jul 2018, 13:55
Forum: Ask For Help
Topic: Gui help
Replies: 4
Views: 88

Re: Gui help

Or KeyWait, Enter, Down . However there is a problem here, pressing Enter key in another window will also close the input GUI. Improved code: MsgBox, % sendInputBox() MsgBox, % sendInputBox2() return sendInputBox() { static Gui, 99:+HWNDhGUI Gui, 99:Add, Edit, x2 y9 w270 h20 veditfield +HWNDhEdit, G...
by tmplinshi
13 Jul 2018, 12:54
Forum: Ask For Help
Topic: How to Test if an Excel File open in a script
Replies: 5
Views: 95

Re: How to Test if an Excel File open in a script

Code: [Select all]GeSHi © Codebox Plus

IsFileInUse(FileName) {
return FileExist(FileName) && !FileOpen(FileName, "rw")
}
by tmplinshi
13 Jul 2018, 12:45
Forum: Ask For Help
Topic: Gui help
Replies: 4
Views: 88

Re: Gui help

Nice idea to use while(!GetKeyState("Enter", "p")). But at least add 1 milliseconds to it, otherwise the script will take up a lot of CPU, 8% for me.

Code: [Select all]GeSHi © Codebox Plus

while(!GetKeyState("Enter", "p"))
sleep 1
by tmplinshi
13 Jul 2018, 00:24
Forum: 请求帮助
Topic: 自定义热键如何再用 Topic is solved
Replies: 11
Views: 179

Re: 自定义热键如何再用 Topic is solved

放在 AutoHotkey 的安装目录,即 AutoHotkey.exe 所在文件夹。

比如安装目录是 C:\Program Files\AutoHotkey
则 Lib 目录为 C:\Program Files\AutoHotkey\Lib\
by tmplinshi
12 Jul 2018, 11:40
Forum: Scripts and Functions
Topic: .NET Framework Interop (CLR, C#, VB)
Replies: 130
Views: 31429

Re: .NET Framework Interop (CLR, C#, VB)

hmm.. that's difficult for me to continue, I'm giving up on this dll. Thanks again.
by tmplinshi
11 Jul 2018, 08:25
Forum: 请求帮助
Topic: 自定义热键如何再用 Topic is solved
Replies: 11
Views: 179

Re: 自定义热键如何再用 Topic is solved

你可以把函数代码保存到一个文件中,比如 functions.ahk,然后把这个文件放在 AutoHotkey安装目录\Lib\ 目录下。之后你每个脚本都能直接调用里面的函数。
如果不放在 Lib\ 目录下的话,那你需要在每个脚本中用 #Include D:\test\functions.ahk 命令引用这个文件。
by tmplinshi
10 Jul 2018, 23:56
Forum: 请求帮助
Topic: 自定义热键如何再用 Topic is solved
Replies: 11
Views: 179

Re: 自定义热键如何再用 Topic is solved

用函数。

Code: [Select all]GeSHi © Codebox Plus

f4::action1()

action1()
{
send !m{enter 5}!s
}

action1 是函数名称,可以随便取。
by tmplinshi
08 Jul 2018, 10:55
Forum: Scripts and Functions
Topic: .NET Framework Interop (CLR, C#, VB)
Replies: 130
Views: 31429

Re: .NET Framework Interop (CLR, C#, VB)

Thanks lexikos! Good to know ComObject(13,0) for null parameters, that's a useful info for using CLR.ahk. gumbo := Clr_CreateObject(GumboBindings, "Gumbo.Wrappers.GumboWrapper", testHtml, ComObject(13, 0)) But adding to it, another error occurred :| --------------------------- gumb...
by tmplinshi
07 Jul 2018, 02:19
Forum: Scripts and Functions
Topic: .NET Framework Interop (CLR, C#, VB)
Replies: 130
Views: 31429

Re: .NET Framework Interop (CLR, C#, VB)

The error message is in Chinese language, so I didn't include the message, my bad, I was too lazy. I have changed the OS language to English, the error was: --------------------------- gumbo test.ahk --------------------------- Error in #include file "D:\code\AutoHotkey\Lib\Clr.ahk": 0x801...
by tmplinshi
06 Jul 2018, 09:40
Forum: Ask For Help
Topic: Json reading from website query (Remake due to unable to view) Topic is solved
Replies: 2
Views: 61

Re: Json reading from website query (Remake due to unable to view) Topic is solved

Compression Add a request header with Accept-Encoding: gzip to get compressed results. This dramatically reduces the size of the response and will speed up your API requests. The "Msxml2.XMLHTTP" component can automatically add Accept-Encoding: gzip header and decode the compressed data. ...
by tmplinshi
06 Jul 2018, 08:42
Forum: Ask For Help
Topic: AHK not running Powershell Correctly Topic is solved
Replies: 5
Views: 128

Re: AHK not running Powershell Correctly Topic is solved

You can also use -EncodedCommand with the Base64-Encoded string. command = ( echo a echo b ) base64Str := b64_encode(command, true) Run, powershell -NoExit -EncodedCommand "%base64Str%" ; https://gist.github.com/tmplinshi/3776c215152436c6f1d722e0151d2fcb b64_encode(p*) { return b64.encode(...
by tmplinshi
05 Jul 2018, 21:27
Forum: Ask For Help
Topic: AHK to run PowerShell command Topic is solved
Replies: 6
Views: 112

Re: AHK to run PowerShell command Topic is solved

It's because of the spaces in your path. You can either use:

Code: [Select all]GeSHi © Codebox Plus

Run powershell -NoExit -Command "Import-Csv \"D:\Desktop\your file.csv\" | Out-GridView"

or:

Code: [Select all]GeSHi © Codebox Plus

Run powershell -NoExit -Command "Import-Csv 'D:\Desktop\your file.csv' | Out-GridView"
by tmplinshi
05 Jul 2018, 20:08
Forum: Ask For Help
Topic: AHK to run PowerShell command Topic is solved
Replies: 6
Views: 112

Re: AHK to run PowerShell command Topic is solved

Code: [Select all]GeSHi © Codebox Plus

Run, powershell -NoExit -Command "Import-Csv D:\Desktop\yourfile.csv | Out-GridView"
by tmplinshi
04 Jul 2018, 15:33
Forum: Ask For Help
Topic: EPPlus help needed - redux Topic is solved
Replies: 10
Views: 213

Re: EPPlus help needed - redux Topic is solved

Based on your work, I searched for epplus "Worksheets.AddChart" . Working example: [code file=EPPlus Test - AddChart (Seperate Sheet).ahk:1cr7zl4q]#NoEnv SetWorkingDir %A_ScriptDir% EPPlus := Clr_LoadLibrary("EPPlus.dll") pck := EPPlus.CreateInstance("OfficeOpenXml.ExcelPack...
by tmplinshi
03 Jul 2018, 14:15
Forum: Ask For Help
Topic: AutoCAD_Get
Replies: 3
Views: 113

Re: AutoCAD_Get

by tmplinshi
03 Jul 2018, 05:32
Forum: Ask For Help
Topic: A simple launcher tool... Topic is solved
Replies: 4
Views: 187

Re: A simple launcher tool... Topic is solved

I'm using WIN10 x64 (Chinese language), I have no issues passing unicode filenames and parameters.

Code: [Select all]GeSHi © Codebox Plus

Print Command(1) ; " " ; Command(2)
Exec ( Command(1), Command(2) )


Image
by tmplinshi
02 Jul 2018, 08:31
Forum: Scripts and Functions
Topic: .NET Framework Interop (CLR, C#, VB)
Replies: 130
Views: 31429

Re: .NET Framework Interop (CLR, C#, VB)

I wonder if ComObjCreate("HTMLFile") is reliable, due to different IE browser version. Although I have a function like this: html2dom(ByRef html, RemoveHeadAndImg = true) { if RemoveHeadAndImg { html := RegExReplace(html, "`as)<head>.*?</head>") html := RegExReplace(html,...
by tmplinshi
02 Jul 2018, 08:06
Forum: Scripts and Functions
Topic: .NET Framework Interop (CLR, C#, VB)
Replies: 130
Views: 31429

Re: .NET Framework Interop (CLR, C#, VB)

Can someone tell me why this doesn't work? testHtml := "<html><body class=""gumbo"">Boo!</body></html>" GumboBindings := Clr_LoadLibrary("Gumbo.Bindings.dll") gumbo := Clr_CreateObject(GumboBindings, "Gumbo.Wrappers.GumboWrapper", testHtml) MsgBox, %...
by tmplinshi
01 Jul 2018, 09:32
Forum: Ask For Help
Topic: EPPlus help needed - redux Topic is solved
Replies: 10
Views: 213

Re: EPPlus help needed - redux Topic is solved

I also tried this but didn't work: eChartType := EPPlus.CreateInstance("OfficeOpenXml.Drawing.Chart.eChartType") myChart := ws.Drawings.AddChart("chart1", eChartType.Pie) #NoEnv SetWorkingDir %A_ScriptDir% EPPlus := Clr_LoadLibrary("EPPlus.dll") pck := EPPlus.Cr...

Go to advanced search