취보특개

오토핫키 사용법 본문

Gaebal

오토핫키 사용법

ha3kkkkk 2022. 8. 17. 15:34

 

 

변수 사용

x := 330
MsgBox, %x%

 

함수 사용

Upload_Board(title, href)
{
	return title
}

 

클릭(Click)

;Click x, y
Click 200, 300

아래는 좌표를 찾을때 쓰는 프로그램(Window Spy)이다.

나의 경우 좌표값으로 절대적인 값인 Screen을 쓰는데,

기본적으로는 Window 좌표값으로 동작하기때문에 아래의 코드를 시작할때 추가해줘야한다.

CoordMode, Mouse, Screen

 

 

기다리기(Sleep)

Sleep, 1000  ; 1초

 

 

특정 키 누르면 동작

F2::
	ExitAPP
return

 

 

한/영 키 확인

출처: https://blog.hangyeong.com/821 [블로그한경닷컴:티스토리]

WinGetActiveTitle, ExplorerTitle

Convert_Eng_To_Kor()
{
	ime_status := % IME_CHECK("A")
	if (ime_status = "0") {
		Send, {vk15sc138}
	}
}
Convert_Kor_To_Eng()
{
	ime_status := % IME_CHECK("A")
	if (ime_status = "1") {
		Send, {vk15sc138}
	}
}

IME_CHECK(WinTitle) 

{
	WinGet,hWnd,ID,%WinTitle%
	Return Send_ImeControl(ImmGetDefaultIMEWnd(hWnd),0x005,"")
}

Send_ImeControl(DefaultIMEWnd, wParam, lParam)
{
	DetectSave := A_DetectHiddenWindows
	DetectHiddenWindows,ON
	SendMessage 0x283, wParam,lParam,,ahk_id %DefaultIMEWnd%
	if (DetectSave <> A_DetectHiddenWindows)
		DetectHiddenWindows,%DetectSave%
	return ErrorLevel
}

ImmGetDefaultIMEWnd(hWnd)
{
	return DllCall("imm32\ImmGetDefaultIMEWnd", Uint,hWnd, Uint)
}

 

 

파일 읽기(FileRead)

FileRead, fdata, sample.txt
MsgBox, %fdata%

 

파일 한줄 읽기(FileReadLine)

FileReadLine, fdata, sample.txt, 1
MsgBox, %fdata%

 

파일 한줄씩 모두 읽기

Loop
{
    FileReadLine, fdata, sample.txt, %A_index%
    if (ErrorLevel = 1)
        break
    MsgBox, %fdata%
}

 

파일 한줄씩 특정 갯수 읽기

idx := 1
Loop
{
	FileReadLine, fdata, sample.txt, idx
	if (idx = 10)
		break
	else{
		MsgBox, %idx% %fdata%
		idx := idx + 1
	}
}

 

 

 

 

'Gaebal' 카테고리의 다른 글

Git Usage  (0) 2021.02.20
Comments