Search found 181 matches

by john_c
04 Jun 2019, 20:28
Forum: Ask For Help
Topic: How does files loop works? Topic is solved
Replies: 4
Views: 199

Re: How does files loop works? Topic is solved

> Note the loop will give you the names requested Yeah, you are correct, thanks. > The mistake is: `FileCopyDir` does not copy files, only folders. `FileCopyDir` will not do what you want, when you don't give it what it asks for, namely: an (existing) folder name. Well, it seems I need to use both F...
by john_c
04 Jun 2019, 20:06
Forum: Ask For Help
Topic: How does files loop works? Topic is solved
Replies: 4
Views: 199

Re: How does files loop works? Topic is solved

wolf_II Well, it was said a bit unclear. Yes, they don't copy anything, they are parameters. But these parameters doesn't give the expected result. For example, when I use DF parameters, I expect that both files and directories will be copied. Edit: FileCopyDir is working on Folders only, I think. ...
by john_c
04 Jun 2019, 19:49
Forum: Ask For Help
Topic: How does files loop works? Topic is solved
Replies: 4
Views: 199

How does files loop works? Topic is solved

Could anybody explain how files Loop actually works? https://www.autohotkey.com/docs/commands/LoopFile.htm: Loop, Files, FilePattern, Mode Mode: Zero or more of the following letters: D : Include directories (folders). F : Include files. If both F and D are omitted, files are included but not folder...
by john_c
04 Jun 2019, 18:24
Forum: Ask For Help
Topic: FileCopy doesn't work as expected Topic is solved
Replies: 6
Views: 244

Re: FileCopy doesn't work as expected Topic is solved

wolf_II The problem with the example posted in the docs is that _on my computer_ it tries to use FileCopy before the new directory is created - and, of course, it fails. If you move FileCopy after the loop - everything works. But still, it is strange that: 1) The posted version doesn't properly wor...
by john_c
04 Jun 2019, 18:00
Forum: Ask For Help
Topic: FileCopy doesn't work as expected Topic is solved
Replies: 6
Views: 244

Re: FileCopy doesn't work as expected Topic is solved

@Albireo It's not some "program", it is just a copy-paste from docs. But for some reason this copy-paste doesn't work. I cannot understand is it a bug, an error in the docs or something different.
by john_c
04 Jun 2019, 13:31
Forum: Ask For Help
Topic: FileCopy doesn't work as expected Topic is solved
Replies: 6
Views: 244

FileCopy doesn't work as expected Topic is solved

The example for FileCopy doesn't work as expected. Link to original code: https://www.autohotkey.com/docs/commands/FileCopy.htm The version with simplified directory names (Foo and Bar): ; The following example copies all files and folders inside a folder to a different folder: ErrorCount := CopyFil...
by john_c
02 Oct 2018, 04:11
Forum: Ask For Help
Topic: PID (Process ID) - Run command vs. program's windows
Replies: 1
Views: 238

PID (Process ID) - Run command vs. program's windows

Check this: F1:: WinGet, Pid, PID, A MsgBox, % Pid Return F2:: Run, C:\Program Files\Google\Chrome\Application\Chrome.exe,,, ChromePid MsgBox, % ChromePid Return To properly perform the test: Ensure that Chrome is closed Press F2. Notice the PID from message box Press F1. Notice the PID from message...
by john_c
16 Sep 2018, 08:04
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Re: Prevent hotkey from repeating

Nextron wrote:...
@Nextron Hm, yes, I see.

I press F1, then F2. Then release F1 and try to press it again - nothing happens.

Update: Just discovered, that Rohwedder's example works correctly for such case! :)
by john_c
16 Sep 2018, 07:38
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Re: Prevent hotkey from repeating

... Hallo :) Looks very interesting. I will need some time today to figure out how it works! :) I understand, your script intended to avoid some possible pitfalls of my original version and you have much more knowledge about AutoHotkey. But could you please elaborate at which exactly point it is be...
by john_c
16 Sep 2018, 07:21
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Re: Prevent hotkey from repeating

... @Nextron Thanks, it was very useful! Now I understand. So, it seems that for simple cases, when we need to launch some action immediately, placing KeyWait after this action (instead of before ), is the best solution? F1:: MsgBox F1 released KeyWait,F1 Return F2:: MsgBox F2 released KeyWait,F2 R...
by john_c
16 Sep 2018, 06:40
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Re: Prevent hotkey from repeating

The biggest problem with keywait you'll encounter is due to threading, when you're implementing it on multiple keys and press and hold them. The keywait of the first key will be interrupted by the second key until the second key is released, regardless whether the first key has been released (and p...
by john_c
16 Sep 2018, 06:37
Forum: Ask For Help
Topic: What is the most correct way to run a program? It's not so obvious!
Replies: 9
Views: 833

Re: What is the most correct way to run a program? It's not so obvious!

I realize I may have misinterpreted the question; that the emphasis may have been on always using KeyWait, and not on where to place it (" before last Return"). It is not best practice to block key-repeat. However, if you want to do it, KeyWait is the easiest way. Thanks! Yes, it was exactly what I...
by john_c
16 Sep 2018, 06:34
Forum: Ask For Help
Topic: What is the most correct way to run a program? It's not so obvious!
Replies: 9
Views: 833

Re: What is the most correct way to run a program? It's not so obvious!

Then what is the difference, please, with using something like F11 UP:: ? Do you think that this is valid and logical or that KeyWait is more appropriate? Hi! I'm just newbie. Notice the difference: 1st example: SendInput will be launched when you RELEASE the button. It's NOT how Windows works by d...
by john_c
15 Sep 2018, 17:39
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Re: Prevent hotkey from repeating

@wolf_II Thanks, I will look at it!
by john_c
15 Sep 2018, 17:13
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Re: Prevent hotkey from repeating

wolf_II wrote:You could play with the UP versions of the respective hotkeys, DRock did something similar and it works well for his case.
Thanks! I tried to find DRock on forum and with Google, but haven't found anything. Probably you have a link?
by john_c
15 Sep 2018, 16:32
Forum: Ask For Help
Topic: Prevent hotkey from repeating
Replies: 17
Views: 1002

Prevent hotkey from repeating

Here is very simple function to prevent hotkey repeating: (I mean, when we press some hotkey, but continue to keep our fingers on buttons, instead of quickly release them). PreventRepeating() { KeyWait, Alt KeyWait, Ctrl KeyWait, Shift KeyWait, LWin KeyWait, RWin KeyWait, %A_ThisHotkey% } F1:: SendI...
by john_c
15 Sep 2018, 05:26
Forum: Ask For Help
Topic: What is the most correct way to run a program? It's not so obvious!
Replies: 9
Views: 833

Re: What is the most correct way to run a program? It's not so obvious!

Most likely the solution you're after is to simply put KeyWait, F1 after SendInput, #1 . Thanks! Yes, it seems to work correctly! Isn't it a best practice to always use KeyWait before last Return ? Different to what? It is consistent with standard Windows 10 behaviour. If I hold #1, it will repeate...
by john_c
14 Sep 2018, 20:42
Forum: Ask For Help
Topic: What is the most correct way to run a program? It's not so obvious!
Replies: 9
Views: 833

What is the most correct way to run a program? It's not so obvious!

The question seems to be very easy, but it's not so obvious. For example, try to press Win+1 without AutoHotkey. What will you see? As soon as you pressed it, the first program from taskbar will be launched. And here is simple script for it: ; This: F1:: SendInput, #1 ; Or this: F1:: #1 But with scr...

Go to advanced search