Search found 287 matches

by dmg
01 Jun 2020, 14:17
Forum: Ask for Help (v1)
Topic: Don't execute script if a specified key was pressed before the hotkey Topic is solved
Replies: 3
Views: 528

Re: Don't execute script if a specified key was pressed before the hotkey Topic is solved

Try this: ~enter::flag := !flag #If WinActive("ahk_exe notepad.exe") and !(flag) g:: +g:: Send, é Sleep, 400 Send, q Sleep, 500 Send, í return #If It sets the enter key as a hotkey that sets the state of the flag variable to be the logical opposite of its current state. Allowing it to act as a toggl...
by dmg
29 May 2020, 15:57
Forum: Ask for Help (v1)
Topic: Way to have Send send literal { and } withought trying to interpret them? (not SendRaw) Topic is solved
Replies: 4
Views: 629

Re: Way to have Send send literal { and } withought trying to interpret them? (not SendRaw) Topic is solved

Thanks, BoBo. I looked at the docs and tried it in the code, but I don't think it will work. It looked promising though, thanks.

Any other ideas? Why doesn't escaping them seem to do anything?
by dmg
29 May 2020, 13:20
Forum: Ask for Help (v1)
Topic: Office Clipboard
Replies: 2
Views: 353

Re: Office Clipboard

I can't help with COM, but maybe there is a way to do what you want without using the clipboard? This function 'pastes' text directly into the active input capable GUI control: _paste(text) { controlgetfocus, control, % winexist("a") control, editpaste, %text%, %control% return errorlevel }
by dmg
29 May 2020, 13:15
Forum: Ask for Help (v1)
Topic: Way to have Send send literal { and } withought trying to interpret them? (not SendRaw) Topic is solved
Replies: 4
Views: 629

Way to have Send send literal { and } withought trying to interpret them? (not SendRaw) Topic is solved

I am working with code that relies heavily on the Send command and handles blocks of text from multiple sources including the clipboard. I'm trying to take as many use cases into account as possible and one issue I've seen is if a text block has { and } in it, such as a piece of AHK code, then the S...
by dmg
25 May 2020, 21:21
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

Ok... I thought about what would be needed to convert my code to not rely on the Input command as much. I realized a couple of things, and wrote a little test code... Then modified my script, and it looks like it works??? It can't be that easy! :headwall: #singleinstance, ignore #installkeybdhook se...
by dmg
24 May 2020, 18:08
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

Thank you swagfag. I am pretty sure this can't be done, at least not without starting my script from scratch, but I would be happy for a second opinion. :D My script is supposed to be a text expansion and replacement app. It draws these replacements from the strings.txt file. Each (non empty) line i...
by dmg
24 May 2020, 09:39
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

I have been trying to fix this for a few days, and I have realized embarrassingly late that what I am trying to do is not possible. My code relies heavily on the built in monitoring and reactions of the Input command (EndKey and MatchList). So no matter what I do with the content of variables AFTER ...
by dmg
24 May 2020, 09:09
Forum: Ask for Help (v1)
Topic: AutoHotKey Password
Replies: 14
Views: 1900

Re: AutoHotKey Password

This is probably far more complicated than you are looking for, but I wrote an app in AutoHotkey years ago that does this:
https://www.portablefreeware.com/index.php?id=2265

You set trigger codes and when you type them into a small prompt the app can execute programs, open files, load websites etc.
by dmg
20 May 2020, 18:11
Forum: Ask for Help (v1)
Topic: Using shift as a modifier?
Replies: 4
Views: 432

Re: Using shift as a modifier?

Well, you could have a shif-a hotkey:

Code: Select all

+a::send, F
But that would not be specifically LEFT shift. Does this work?
by dmg
20 May 2020, 08:06
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

Thanks for the altered code. It is indeed easier to understand. When I said your code looked like gibberish to me I was only explaining why I was having trouble with it, not that I wanted more of an explanation. But thank you. :D switch should be closer to 0% gibberish Why would you think that? I ha...
by dmg
20 May 2020, 07:42
Forum: Ask for Help (v1)
Topic: Passing variables to another script...
Replies: 2
Views: 786

Re: Passing variables to another script...

It is certainly possible, and there are several ways to do it. I am curious though, why not just have everything happen in the elevated script? The two easiest ways to pass variables between scripts are: Have a text file that one script writes content to and the second script reads from on a timer. ...
by dmg
19 May 2020, 19:05
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

Hmmm, OK. See, the last time I really worked with AHK InputHook() and Switch didn't exist, at all. So your code is about 95% gibberish to me. :crazy:

I will tinker with it and see if I can learn from it and if it can be applied to my problem. Thanks!
by dmg
19 May 2020, 18:20
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

Hi swagfag . Thanks for replying. I assume you mean copy the input to a middle-man variable so it's not lost when the Input blanks its variable. That is the only thing that came to mind for me to, only it's more complicated than that. I remember when I first wrote this, something like 7 years ago, t...
by dmg
19 May 2020, 11:10
Forum: Ask for Help (v1)
Topic: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC
Replies: 21
Views: 3331

Re: LONG STORY. Input/InputHook(), Hotstring(), AHK_H, ETC

(This was previously posted on the wrong thread) I have mostly deciphered my old code... And found MANY problems with it. :lol: I can sort most of it out myself eventually, but right now I have questions: I used the input command to monitor typing for use as a very hotkey-like function. Back when I ...
by dmg
19 May 2020, 07:19
Forum: Ask for Help (v1)
Topic: Input command options
Replies: 8
Views: 832

Re: Input command options

(I posted this here in error. Please reply over in the correct thread: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=75436) I have mostly deciphered my old code... And found MANY problems with it. :lol: I can sort most of it out myself eventually, but right now I have questions: I used the ...
by dmg
19 May 2020, 06:50
Forum: Ask for Help (v1)
Topic: Input command options
Replies: 8
Views: 832

Re: Input command options

It was gone since there was no Input command/function in v2 anymore, I have added it to features: http://hotkeyit.github.io/v2/docs/AutoHotkey.htm InputHook Option A: When using option A, previous input or text set via MyInputHook.Input := Text will not be discarded, instead new input will be appen...
by dmg
14 May 2020, 12:10
Forum: Ask for Help (v1)
Topic: Transform a character into a word from a list Topic is solved
Replies: 12
Views: 987

Re: Transform a character into a word from a list Topic is solved

Sooo... Apparently associative array keys have always been case insensitive, and it has caused annoyance for years. There are some work arounds though, like: array := {Asc("a"):"1",Asc("A"):"2"} MsgBox % array[Asc("a")] MsgBox % array[Asc("A")] comChar := Asc("b") array := {Asc("a"):"add", Asc("b"):...
by dmg
14 May 2020, 11:53
Forum: Ask for Help (v1)
Topic: Transform a character into a word from a list Topic is solved
Replies: 12
Views: 987

Re: Transform a character into a word from a list Topic is solved

BNOLI wrote:
14 May 2020, 11:39
I found it interesting that the OP...
That is... Strange, and a little unsettling. I tried StringCaseSense but that doesn't affect it. Surely arrays CAN be case sensitive? Right???
by dmg
14 May 2020, 10:01
Forum: Ask for Help (v1)
Topic: Transform a character into a word from a list Topic is solved
Replies: 12
Views: 987

Re: Transform a character into a word from a list Topic is solved

If you create an array instead of a match-list you would be able to reduce the rest of your code. What's the source of your data (file/clipboard/...)? Darn it, BoBO. You got there ahead of me. But I have a code example, so HA! :D comChar := "b" array := {"a":"Add", "b":"Bench", "d":"Delete"} comCha...

Go to advanced search