Tips
- Nginx에 Letsencrypt 적용하기 2019.09.19
- Autohotkey, 문자열의 일부를 잘라 비교하기 2019.09.18
- Intel Desktop Board(인텔 메인보드) DH55PJ BIOS(바이오스) 진입키 2019.08.29
- Autohotkey, GUI 버튼 활성화/비활성화 2019.06.12 1
- Autohotkey, 마우스 드래그 2019.06.10
- Autohotkey, 지정한 위치의 칼라코드값 얻기 2019.05.30
- Autohotkey 윈도우 위치 및 크기 알아내기 2019.05.30 1
- 익스플로러 새창 옆 Edge로 열기 아이콘 제거 2019.05.21
Nginx에 Letsencrypt 적용하기
Autohotkey, 문자열의 일부를 잘라 비교하기
Autohotkey(오토핫키), 문자열 잘라내기
보통 Autohotkey(오토핫키)를 이용해 화면의 색상을 읽어내면 0xCBE6F0 과 같은 형식으로 나타납니다. 이 색상코드를 이용하기 위해 일부 문자를 잘라내야 했습니다. 0x 이후의 문자를 잘라 그 값을 이용해야 하는 경우가 생겨 레퍼런스를 보니 문자열에 관련된 함수가 무척 많았습니다. 오류 검사만 좀 더 쉽다면 정말 멋진 스크립트 언어네요.
0xCBE6F0에서 C값을 빼내고 싶었습니다. 이 경우엔 SubStr함수를 이용하면 되네요. 이 함수는 다른 언어에도 많이 있어서 쉽게 사용이 가능했습니다.
SubStr(문자열, 잘라낼시작위치, 잘라낼문자갯수)
단지 언어마다 다르듯 시작위치를 0에서 시작하느냐 1에서 시작하느냐의 차이가 있을텐데 오토핫키는 1로 시작됩니다.
따라서 제가 원하는걸 하려면 SubStr, 3, 1로 해야 합니다.
간단한 예제)
PixelGetColor, valColor, 345, 567
valFirst := SubStr(valColor, 3, 1)
if (valFirst is not number)
{
..... ; 조건에 맞을때 해야 할것들
}
Intel Desktop Board(인텔 메인보드) DH55PJ BIOS(바이오스) 진입키
Intel
DH55PJ
바이오스 진입
F2
바이오스 내에서 변경시
바이오스 업데이트
F7
바이오스 부팅메뉴 선택
F10
Autohotkey, GUI 버튼 활성화/비활성화
Autohotkey, GUI 버튼 활성화/비활성화
GuiControl, Enable/Disable, Btn
간단설명)
일반적으로 GuiControl을 이용해 GUI의 다양한 부분들을 콘트롤 하는게 가능합니다. 그중 버튼을 활성화 하거나 비활성화 할때 Enable, Disable을 이용합니다. 그외의 사용법은 레퍼런스에 나와있습니다.
GuiControl - Syntax & Usage | AutoHotkey
If the target control has an associated variable, specify the variable's name as the ControlID (this method takes precedence over the ones described next). For this reason, it is usually best to assign a variable to any control that will later be accessed
www.autohotkey.com
예)
Gui, Add, Button, x20 y10 w100 h25 gButton1 vBtn1, 비활성화
Gui, Add, Button, x130, y10 w100 h25 gButton2 vBtn2, <- 활성화시키기
Gui, Show
Return
gButton1:
{
GuiControl, Disable, vBtn1
}
Return
gButton2:
{
GuiControl, Enable, vBtn1
}
Return
; 처음 실행시 Disable을 시키려면 Gui, Add, Button, ..... gButton1 vBtn1 + Disabled, 비활성으로시작
Autohotkey, 마우스 드래그
Autohotkey, 마우스 드래그
MouseClickDrag, WhichButton, startx, starty, endx, endy, Speed, Relative
간단설명)
MouseClickDrag, 어떤버튼을 누를건지(Left, Right...), 시작점X좌표, 시작점Y좌표, 끝점X좌표, 끝점Y좌표, 속도, 상대위치여부
속도는 0~100(0 : 빠름, 100 : 느림)
Relative에 R로 설정하면 시작 좌표에서 두번째 좌표까지의 거리로 이동(시작점X좌표에서 끝점X좌표픽셀만큼 이동)
MouseClickDrag - Syntax & Usage | AutoHotkey
The button to click: Left, Right, Middle (or just the first letter of each of these). Specify X1 for the fourth button and X2 for the fifth. For example: MouseClickDrag, X1, .... To compensate automatically for cases where the user has swapped the left and
www.autohotkey.com
예)
MouseClickDrag, Left, 100, 100, 223, 445, 20
Autohotkey, 지정한 위치의 칼라코드값 얻기
Autohotkey, 지정한 위치의 칼라코드값 얻기
PixelGetColor, OutputVar, X, Y
간단설명)
PixelGetColor, 칼라값을얻을변수, 색상을얻어올X좌표, 색상을얻어올Y좌표
여기의 X, Y좌표는 활성화된 창의 좌표
PixelGetColor - Syntax & Usage | AutoHotkey
The name of the variable in which to store the color ID in hexadecimal blue-green-red (BGR) format. For example, the color purple is defined 0x800080 because it has an intensity of 80 for its blue and red components but an intensity of 00 for its green com
autohotkey.com
예)
PixelGetColor, vColor, 100, 100
If (vColor = "0xE5E5E5")
{
색상이 바뀐것에 관련된 처리
}
루프안에 위 코드를 넣어 일정시간 딜레이를 줘가며 화면의 변화를 체크할때 좋습니다.
Autohotkey 윈도우 위치 및 크기 알아내기
Autohotkey, 윈도우 위치 및 크기 알아내기
WinGetPos, winx, winy, winw, winh, WindowTitle
간단설명)
WinGetPos, x위치받아올변수, y위치받아올변수, 윈도우너비받아올변수, 윈도우높이받아올변수, 자료를얻고싶은윈도우타이틀의 앞쪽일부문자
WinGetPos - Syntax & Usage | AutoHotkey
The names of the variables in which to store the X and Y coordinates of the target window's upper left corner. If omitted, the corresponding values will not be stored.
autohotkey.com
WinTitle & Last Found Window | AutoHotkey
The WinTitle Parameter & the Last Found Window Many commands and a few functions have a WinTitle parameter, used to identify which window (or windows) to operate on. This parameter can be the title or partial title of the window, and/or any other criteria
autohotkey.com
예)
IfWinExist, 계산
{
WinGetPos, calx, caly, calw, calh, 계산
MsgBox, 계산기가 %calx%, %caly% 위치에 있고 그 크기는 %calw%, %calh% 입니다.
} else {
MsgBox, 계산기가 열려있지 않습니다!
}
익스플로러 새창 옆 Edge로 열기 아이콘 제거
윈도우 10(8은 기억이 나질 않네요. 워낙 짧게 거쳐가서....)의 익스에서 Edge를 사용하게끔 Edge아이콘이 나오는데 새창을 열때 실수로 이걸 클릭하는 경우가 생기는 경우가 많네요.
이 아이콘을 제거하려면
익스 메뉴중 옵션 - 고급 - [Microsoft Edge를 여는 단추]의 체크를 해제
차후엔 Edge가 크로미움으로 바뀐다던데 그때도 이 단추가?