Search found 1527 matches

by tmplinshi
18 Nov 2019, 11:32
Forum: Ask For Help
Topic: How can I get the data from txt file? Topic is solved
Replies: 23
Views: 561

Re: How can I get the data from txt file? Topic is solved

LoadData_GroupA("G:\Download\") LoadData_GroupA(Folder) { objA := {} Loop, Files, % Folder . "\CA_T*.txt" { FileRead, data, %A_LoopFileFullPath% r := "s)\R\((?P<date>\d{2}/\d{2}/\d{2} \d{2}:\d{2}.\d{2})[^\r\n]+\R+" . "Check BTF13 (?P<num>\d+)" . ".*?\R+ (?P<temp>[\d.+-]+)" startPos := 1 while found...
by tmplinshi
18 Nov 2019, 01:47
Forum: Ask For Help
Topic: Show menu below the button
Replies: 2
Views: 83

Re: Show menu below the button

Use ControlGetPos instead of GuiControlGet , also you can't omit % for this command. gui, add, button, w75 h23 vMyButton gShow HWNDhBtn, Button gui, show, w300 h300 return Show: loop 3 Menu, MyMenu, Add, Menu%A_Index%, MenuHandler ControlGetPos, cX, cY, cW, cH,, ahk_id %hBtn% Menu, MyMenu, Show, % c...
by tmplinshi
18 Nov 2019, 00:23
Forum: Ask For Help
Topic: Wrapper (class/function) for REST with JSON:API
Replies: 11
Views: 432

Re: Wrapper (class/function) for REST with JSON:API

Thanks Chunjee, I found that Coco's class version JSON.ahk doesn't have such problem. It's just a typo in Jxon.ahk:

Code: Select all

else if (val == "true" || val == "false")
	val := %value% + 0
%value% should be %val%. I've submitted a pull request.
by tmplinshi
16 Nov 2019, 23:11
Forum: Ask For Help
Topic: Wrapper (class/function) for REST with JSON:API
Replies: 11
Views: 432

Re: Wrapper (class/function) for REST with JSON:API

Because.. it is easier to type Jxon_Load, and I rarely need to check true value. Also teadrinker's JSON class requires IE9+.
by tmplinshi
16 Nov 2019, 11:28
Forum: 请求帮助
Topic: 如何实现多层键盘切换? Topic is solved
Replies: 8
Views: 598

Re: 如何实现多层键盘切换? Topic is solved

楼主应该是想要显示一个背景色半透明的窗口,我多提供一个代码吧。 ~Alt:: if IsDoubleClick() { RemapKeys := !RemapKeys if RemapKeys ShowTransText("游戏模式") else ShowTransText() } return #If RemapKeys j::Left l::Right i::Up k::Down #If IsDoubleClick() { static doubleClickTime := DllCall("GetDoubleClickTime") KeyWait, % LTrim(A_ThisHotke...
by tmplinshi
15 Nov 2019, 08:58
Forum: 请求帮助
Topic: 如何实现多层键盘切换? Topic is solved
Replies: 8
Views: 598

Re: 如何实现多层键盘切换? Topic is solved

~Alt::IsDoubleClick() ? (RemapKeys := !RemapKeys) : "" #If RemapKeys j::Left l::Right i::Up k::Down #If IsDoubleClick() { static doubleClickTime := DllCall("GetDoubleClickTime") KeyWait, % LTrim(A_ThisHotkey, "~") return (A_ThisHotKey = A_PriorHotKey) && (A_TimeSincePriorHotkey <= doubleClickTime) }
by tmplinshi
15 Nov 2019, 08:23
Forum: Ask For Help
Topic: Wrapper (class/function) for REST with JSON:API
Replies: 11
Views: 432

Re: Wrapper (class/function) for REST with JSON:API

I see that you use Jxon, I assume you have it in your lib, right? Yes. Jxon works fine in most cases, however it cannot handle true value. For example: json = {"data": true, "status": 200, "success": true} obj := Jxon_Load(json) MsgBox % Jxon_Dump(obj) ;==> {"data":"","status":200,"success":""} tea...
by tmplinshi
15 Nov 2019, 01:44
Forum: Ask For Help
Topic: Wrapper (class/function) for REST with JSON:API
Replies: 11
Views: 432

Re: Wrapper (class/function) for REST with JSON:API

Are you looking for something like this? imgur := new restClient( "https://api.imgur.com/3" , {"Authorization": "Client-ID YOUR_CLIENT_ID"} ) MsgBox % imgur.get("/account/tmplinshi").data.id res := imgur.post("/image", FileToByteArray("D:\Desktop\test.png")) MsgBox % res.data.link imgur.delete("/ima...
by tmplinshi
13 Nov 2019, 08:55
Forum: Ask For Help
Topic: How can I get the data from txt file? Topic is solved
Replies: 23
Views: 561

Re: How can I get the data from txt file? Topic is solved

... gui, show LoadData("G:\Download\a.log", "G:\Download\b.txt") return LoadData(FileA, FileB) { FileRead, data, %FileA% objA := RegExMatchAll_Obj(data, "`s)Check BTF\d+ (\d+).*?\R+ ([\d.+-]+)") FileRead, data, %FileB% objB := RegExMatchAll_Obj(data, "\R(?:3AAAAA |3 *Bank ).*?\R+\d+ *\d+ *(\d+).*?(...
by tmplinshi
10 Nov 2019, 01:39
Forum: Ask For Help
Topic: How do you "click" the 5 number on the Windows 10 calculator
Replies: 26
Views: 990

Re: How do you "click" the 5 number on the Windows 10 calculator

@teadrinker nice, tested and worked. How dumb am I, I forgot child windows are just controls of the parent window :facepalm:
by tmplinshi
09 Nov 2019, 21:08
Forum: Ask For Help
Topic: How do you "click" the 5 number on the Windows 10 calculator
Replies: 26
Views: 990

Re: How do you "click" the 5 number on the Windows 10 calculator

@malcev oh, I modified the acc library to support "," separator, because the path I copied from AccViewer is using comma. I should modify AccViewer instead.
by tmplinshi
09 Nov 2019, 09:21
Forum: Ask For Help
Topic: How do you "click" the 5 number on the Windows 10 calculator
Replies: 26
Views: 990

Re: How do you "click" the 5 number on the Windows 10 calculator

calc.png As you can see in the Window Detective software, the calclulator's class is Windows.UI.Core.CoreWindow , and it is a child window of ApplicationFrameWindow . if !hWnd_calc := WinExist("calculator ahk_class ApplicationFrameWindow") throw "calculator not found" ; Make sure the calclulator is...
by tmplinshi
08 Nov 2019, 01:59
Forum: Ask For Help
Topic: binary data from clipbooard
Replies: 2
Views: 189

Re: binary data from clipbooard

#Include <Gdip_All> MsgBox, % link := Imgur_UploadFromClipboard("Your_Client_ID") Run, % link Imgur_UploadFromClipboard(ClientID) { body := ClipImageToByteArray() whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") ; whr.SetProxy(2, "localhost:1080") whr.Open("POST", "https://api.imgur.com/3/image", ...
by tmplinshi
07 Nov 2019, 00:20
Forum: Ask For Help
Topic: iterate through json using for
Replies: 3
Views: 165

Re: iterate through json using for

Code: Select all

for i, obj in objArray
{
	for k, v in obj
		MsgBox % v
}
by tmplinshi
06 Nov 2019, 23:44
Forum: Ask For Help
Topic: Convert string(text) to html link<a> Topic is solved
Replies: 3
Views: 217

Re: Convert string(text) to html link<a> Topic is solved

You can use WinClip #Include WinClipAPI.ahk #Include WinClip.ahk html := "<a href='https://www.autohotkey.com/'>autohotkey</a>" WinClip.SetHTML(html) /* WinClip.SetText( Html2Text(html) ) Html2Text(ByRef html) { doc := ComObjCreate("HtmlFile") doc.write(html) return doc.documentElement.innerText } */
by tmplinshi
05 Nov 2019, 00:25
Forum: Scripts and Functions
Topic: Windows Data Types for AHK
Replies: 19
Views: 7860

Re: Windows Data Types for AHK

Every time I use the script (offline version), the listview loading time really bugs me.. So I took a look at the script again, and found the reason. loop, parse, MSDN_TYPES, `n, `r { MSDN_TYPES_ARR := StrSplit(A_LoopField, ",") LV_Add("", MSDN_TYPES_ARR[1], MSDN_TYPES_ARR[2], MSDN_TYPES_ARR[3], MSD...
by tmplinshi
04 Nov 2019, 02:43
Forum: Ask For Help
Topic: Extract ZIP to RAM?
Replies: 18
Views: 940

Re: Extract ZIP to RAM?

I don't know :problem:
by tmplinshi
04 Nov 2019, 01:29
Forum: Ask For Help
Topic: Extract ZIP to RAM?
Replies: 18
Views: 940

Re: Extract ZIP to RAM?

Does using multiple files in this way reduce performance? I think so. Might doing it in this way: #NoEnv SetWorkingDir %A_ScriptDir% if (A_Args[1] != "<Fix>") { Run, %A_ScriptFullPath% "<Fix>", % A_ScriptDir ExitApp } global 7zipDll := (A_PtrSize=8) ? "7-zip64.dll" : "7-zip32.dll" DllCall("LoadLibr...
by tmplinshi
01 Nov 2019, 23:46
Forum: Ask For Help
Topic: Extract ZIP to RAM?
Replies: 18
Views: 940

Re: Extract ZIP to RAM?

SetWorkingDir %A_ScriptDir% global 7zipDll := (A_PtrSize=8) ? "7-zip64.dll" : "7-zip32.dll" DllCall("LoadLibrary", "str", 7zipDll, "ptr") MsgBox % SevenZip_ExtractMem2("test.zip", "test2.txt") ExitApp SevenZip_ExtractMem2(archive_name, file_name) { DllCall("CreatePipe", "ptr*", readTemp, "ptr*", wr...

Go to advanced search