Search found 21 matches

by NorInd
30 Dec 2020, 00:58
Forum: Tips and Tricks
Topic: Continuously pressing a hotkey is not working with a KVM (keyboard sharing software).
Replies: 0
Views: 190

Continuously pressing a hotkey is not working with a KVM (keyboard sharing software).

Continuously pressing a hotkey is not working with a KVM (keyboard sharing software, that share your keyboard and mouse among many computers). Lets say you download "Mouse without Borders" in 2 computers, and you have AHK script running in computer B. same AHK script running in both computers (this ...
by NorInd
29 Dec 2020, 23:00
Forum: Ask For Help
Topic: How to create 2 continuous hotkeys? Topic is solved
Replies: 3
Views: 117

Re: How to create 2 continuous hotkeys? Topic is solved

Both mcl & Rohwedder 's method works out pretty well. (For anyone who wants to use Rohwedder 's method, I think it is possible to add a simple if condition to determine the time.) Personally I prefer mcl 's answer, because I prefer the code style that does not use command-like syntax. In terms of pe...
by NorInd
29 Dec 2020, 20:37
Forum: Ask For Help
Topic: How to SendInput or paste without moving the caret (insertion point)?
Replies: 0
Views: 43

How to SendInput or paste without moving the caret (insertion point)?

How to SendInput or paste without moving the caret (insertion point)? I don't want to use the arrow key . ie: SendInput, {Left 2} I want to literally stop the caret from moving. 2 reasons for that, 1. Move the caret back is too slow. 2. It might not move the caret back to its position in some case (...
by NorInd
29 Dec 2020, 20:06
Forum: Ask For Help
Topic: Is there any specific order for the directives# in a AHK script?
Replies: 5
Views: 135

Re: Is there any specific order for the directives# in a AHK script?

Yes. Read control flow . Thank you very much, this document is very helpful. Especially for the following 2 lines:: Not Control Flow As directives, labels (including hotkeys and hotstrings), and declarations without assignments are processed when the script is loaded from file, they are not subject...
by NorInd
28 Dec 2020, 18:09
Forum: Ask For Help
Topic: Is there any specific order for the directives# in a AHK script?
Replies: 5
Views: 135

Re: Is there any specific order for the directives# in a AHK script?

That is explained in the documentation for each directive. I suggest checking each of them there. Some documentation just say place "this directive" on top of the script, but I don't think they specify which one goes in first when there are multiple "directives". Directives are processed before the...
by NorInd
28 Dec 2020, 09:03
Forum: Ask For Help
Topic: Is there any specific order for the directives# in a AHK script?
Replies: 5
Views: 135

Is there any specific order for the directives# in a AHK script?

Is there any specific order for the directives# in a AHK script?
eg:
I have

Code: Select all

#If
SetWorkingDir
#Include
#IfWinActive
MsgBox, HAHA window XXX is active
#NoEnv
; Some random comment
#SingleInstance
global var := ""
How should I order them?
by NorInd
28 Dec 2020, 03:03
Forum: Ask For Help
Topic: Is there a function like [if __name__ == '__main__':] in AHK Topic is solved
Replies: 3
Views: 493

Re: Is there a function like [if __name__ == '__main__':] in AHK Topic is solved

You can just check the variable A_ScriptFullPath . But I still have to write out the Path in text and compare it with A_ScriptFullPath . Is there a way I can just get the name of the file that actually contains the code and then compare it with A_ScriptName (the script that actually runs the code)
by NorInd
28 Dec 2020, 02:44
Forum: Ask For Help
Topic: How to create 2 continuous hotkeys? Topic is solved
Replies: 3
Views: 117

How to create 2 continuous hotkeys? Topic is solved

How to create 2 continuous hotkeys? For example I want to call a message box when I press ctrl+shift+1 then press ctrl+shift+2 Maybe it looks like something like this:: ^+1:: ^+2:: MsgBox, okay return return My solution is using Input , or possibly Keywait , but both are too cumbersome. I think this...
by NorInd
28 Dec 2020, 00:10
Forum: AHK Studio
Topic: How to use spaces instead of tabs as indentation in AHK Studio?
Replies: 1
Views: 80

How to use spaces instead of tabs as indentation in AHK Studio?

How to use spaces instead of tabs as indentation in AHK Studio?

I can't find this option in AHK studio, I only found a Custom Indent by using alt+M but I don't think this is relevant.
by NorInd
20 Dec 2020, 17:18
Forum: AHK Studio
Topic: How to use encoding UTF8 instead of UTF-8 BOM in AHK Studio
Replies: 0
Views: 102

How to use encoding UTF8 instead of UTF-8 BOM in AHK Studio

I have some questions on Encoding UTF8 in AHK Studio. I use UTF-8 in most of my files (not limited to .ahk files, including .txt, .py, etc), and I don't like other encoding methods (eg: ANSI), I don't like them because when I open a non-UTF-8 file in other software, sometimes the characters became ...
by NorInd
20 Dec 2020, 15:19
Forum: AHK Studio
Topic: AHK Studio
Replies: 1163
Views: 444252

Re: AHK Studio

Probably because you downloaded a release rather than the current development code. Or you downloaded from a different branch Situation :: I think your are correct. 1. So I download the code as zip from the main page in github instead of from the release. When I extract the zip, I click No for the ...
by NorInd
08 Dec 2020, 21:13
Forum: AHK Studio
Topic: AHK Studio
Replies: 1163
Views: 444252

Re: AHK Studio

Add noupdate.txt to fix the problem :) Does it work on your computer? Just an empty txt file call noupdate.txt right? I tried it before and tried it just now (tried NoUpdate.txt too), its not working for me. v1.005.32 I have to use v1.005.19 to fix that problem. --- update --- Well, I just checked ...
by NorInd
07 Dec 2020, 19:57
Forum: Ask For Help
Topic: Is there a function like [if __name__ == '__main__':] in AHK Topic is solved
Replies: 3
Views: 493

Is there a function like [if __name__ == '__main__':] in AHK Topic is solved

Is there a function like if __name__ == '__main__': in AHK? In Java or Python they have something like this. What it does is :: { 1. When you are writting in file B, and you run file B, code inside if __name__ == '__main__': will be ran. 2. When you are writting in file A, and you import (or include...
by NorInd
07 Dec 2020, 18:30
Forum: AHK Studio
Topic: AHK Studio
Replies: 1163
Views: 444252

Re: AHK Studio

how do make TAB as SPACES ? Same question. I like using "tab key" to do indentation (with length of 2 white spaces). But I dont want to use "2-space-width Tab" as indentations, I prefer just "2 spaces" to be the identations. Because tabs often get messed up if I open the file with other software or...
by NorInd
07 Dec 2020, 11:29
Forum: AHK Studio
Topic: AHK Studio
Replies: 1163
Views: 444252

Re: AHK Studio

You need to make sure that in the Lib\Languages folder there is a file called ahk.xml in there. If not and you don't have access to the internet you need to download it from another PC and put it there. It's there but still stuck on startup for me :/ I have the same issue. When I have access to the...
by NorInd
07 Dec 2020, 11:13
Forum: AHK Studio
Topic: AHK Studio
Replies: 1163
Views: 444252

Re: AHK Studio

I just downloaded AHK Studio from github. It's a zip file and I get asked if I want to overwrite 2 files when I unzip it. There are 2 different Readme.md files (not a big deal) but there are also 2 different commands.xml. One has a Capital C and the other does not. Same date/time but different size...
by NorInd
20 Nov 2020, 07:35
Forum: Ask For Help
Topic: Why AHK's Regex is so greedy? Topic is solved
Replies: 6
Views: 208

Re: Why AHK's Regex is so greedy? Topic is solved

Thanks for the answers. I think it is because of the `r`n , but I am not sure what the `r`n does, making AHK behave like that. I will look into that. For the flags on the web page, I know few flags on how they works. But I am not sure what makes the difference comparing to coding in a file. I tried ...
by NorInd
20 Nov 2020, 05:55
Forum: Ask For Help
Topic: Why AHK's Regex is so greedy? Topic is solved
Replies: 6
Views: 208

Why AHK's Regex is so greedy? Topic is solved

I was trying to match the last line, and remove it, but in AHK, it matches all the way up to the first occurrence of the line. I have tried to put U) or ? to make it not greedy, but didnt work. Why my code doesn't work in AHK, but works in other websites? #SingleInstance Force a = ( abc 123 ABC ) c ...
by NorInd
19 Nov 2020, 00:08
Forum: Ask For Help
Topic: How to get current line number & go to a line in a txt file
Replies: 6
Views: 213

Re: How to get current line number & go to a line in a txt file

For the reply & code from Rohwedder:: Thanks to Rohwedder again, I really appreciate that you are providing so much help to me and this topic. I am feeling sorry that I am still not sure about marking your answer as the answer or not. Because I am looking for a more general solution that not only a...
by NorInd
17 Nov 2020, 01:29
Forum: Ask For Help
Topic: How to get current line number & go to a line in a txt file
Replies: 6
Views: 213

Re: How to get current line number & go to a line in a txt file

For the answer:: Thanks to Rohwedder, I actually never knew this bookmark feature before. And I just checked the A_CaretY method. It provides coordinate of the caret relative to the window. I think it will work when the windows is fixed, but not when it is scrolled down or up. But I still want a mo...

Go to advanced search