Search found 1598 matches

by tmplinshi
05 Dec 2019, 23:32
Forum: Ask For Help
Topic: Zendesk API
Replies: 6
Views: 1307

Re: Zendesk API

Code: Select all

HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("GET", "https://<myCompanyName>.zendesk.com/api/v2/tickets/<theCaseId>.json")
HTTP.SetCredentials("<userName>", "<password>", 0)
HTTP.Send()

json_str := HTTP.ResponseText

MsgBox % json_str
by tmplinshi
05 Dec 2019, 11:23
Forum: Ask For Help
Topic: Zendesk API
Replies: 6
Views: 1307

Re: Zendesk API

It seems you're using the OAuth access token. Try HTTP.SetRequestHeader("Authorization", "Bearer <superLongToken>")

If you have a working curl command line, it can be very easy translated to AHK code.
by tmplinshi
05 Dec 2019, 06:43
Forum: Ask For Help
Topic: Zendesk API
Replies: 6
Views: 1307

Re: Zendesk API

It should be:
HTTP.SetRequestHeader("Authorization", "Basic <superLongToken>")
or
HTTP.SetCredentials("<Username>", "<Password>", 0)

And..

Code: Select all

URLDownloadToFile, https://<Username>:<Password>@<myCompanyName>.zendesk.com/api/v2/tickets/<theCaseId>.json, zdeskrma.json
by tmplinshi
26 Nov 2019, 23:33
Forum: Ask For Help
Topic: Help with Text Menu script Topic is solved
Replies: 4
Views: 545

Re: Help with Text Menu script Topic is solved

Code: Select all

::cur::
	v = 1=a,"2=""ab"",cd",3=c
	TextMenu(v)
return
If you are confusing about the quotes, you can use Excel to create a CSV file, then open it in notepad.
by tmplinshi
26 Nov 2019, 10:34
Forum: Ask For Help
Topic: Help with Text Menu script Topic is solved
Replies: 4
Views: 545

Re: Help with Text Menu script Topic is solved

TextMenu(TextOptions) { arrVal := [] fn := Func("MenuAction").Bind( arrVal ) Loop, Parse, TextOptions, CSV { arr := StrSplit(A_LoopField, "=", " ") arrVal.push(arr[2]) Menu, MyMenu, Add, % arr[1], % fn } Menu, MyMenu, Show Menu, MyMenu, DeleteAll } MenuAction(arrVal) { SendInput % "{Text}" . arrVal...
by tmplinshi
24 Nov 2019, 00:37
Forum: Ask For Help
Topic: FileSelectFile - control the display view type
Replies: 7
Views: 1001

Re: FileSelectFile - control the display view type

You can use SelectFolderEx() by just me. SetTimer, ChangeDialog, -100 MsgBox, % SelectFolderEx() return ChangeDialog: WinWait, % "ahk_class #32770 ahk_pid " DllCall("GetCurrentProcessId") PostMessage, 0x111, 28751, 0, SHELLDLL_DefView1 ;View, Large icons return ; ====================================...
by tmplinshi
23 Nov 2019, 22:35
Forum: Ask For Help
Topic: AHK and API calls to Internet DOwnload Manager
Replies: 7
Views: 1006

Re: AHK and API calls to Internet DOwnload Manager

Thanks swagfag, SysAllocString function can fix the truncated issue :) CLSID_CIDMLinkTransmitter := "{AC746233-E9D3-49CD-862F-068F7B7CCCA4}" IID_ICIDMLinkTransmitter2 := "{94D09862-1875-4FC9-B434-91CF25C840A1}" tbl := ComObjCreate(CLSID_CIDMLinkTransmitter, IID_ICIDMLinkTransmitter2) bstrUrl := SysA...
by tmplinshi
22 Nov 2019, 02:47
Forum: Ask For Help
Topic: Get my ip-address outside the NAT-router Topic is solved
Replies: 2
Views: 448

Re: Get my ip-address outside the NAT-router Topic is solved

Just grab the ip address from one of the websites.

Code: Select all

MsgBox % GetIP()

GetIP() {
	whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
	whr.Open("GET", "https://api.ipify.org/")
	whr.Send()
	return whr.ResponseText
}
by tmplinshi
22 Nov 2019, 01:43
Forum: Ask For Help
Topic: Extract ZIP to RAM?
Replies: 71
Views: 8002

Re: Extract ZIP to RAM?

oh, I think that's the problem of my SevenZip_ExtractMem2. For now you can use SevenZipExtractMem (https://www.autohotkey.com/boards/viewtopic.php?p=298798#p298798), and make sure that the dlls you use have a SevenZipExtractMem function.
by tmplinshi
22 Nov 2019, 00:46
Forum: Ask For Help
Topic: AHK and API calls to Internet DOwnload Manager
Replies: 7
Views: 1006

Re: AHK and API calls to Internet DOwnload Manager

CLSID_CIDMLinkTransmitter := "{AC746233-E9D3-49CD-862F-068F7B7CCCA4}" IID_ICIDMLinkTransmitter2 := "{94D09862-1875-4FC9-B434-91CF25C840A1}" tbl := ComObjCreate(CLSID_CIDMLinkTransmitter, IID_ICIDMLinkTransmitter2) ; tbl.SendLinkToIDM DllCall(vtable(tbl,3), "ptr", tbl , "str", "https://example.com" ...
by tmplinshi
21 Nov 2019, 23:10
Forum: Ask For Help
Topic: Extract ZIP to RAM?
Replies: 71
Views: 8002

Re: Extract ZIP to RAM?

hasantr That shoudn't be happen, but I tested anyway. I created the folder D:\Folder\inFolder , and copied test.zip to both D:\Folder\ and D:\Folder\inFolder\ , the code just works fine. MsgBox % SevenZip_ExtractMem2("D:\Folder\test.zip", "test2.txt") MsgBox % SevenZip_ExtractMem2("D:\Folder\inFold...
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: 1796

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: 334

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: 1169

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: 1169

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: 9
Views: 84233

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: 9
Views: 84233

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: 1169

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: 1169

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...

Go to advanced search