Search found 122 matches

by Scoox
22 Apr 2020, 13:38
Forum: AutoHotkey v2 Help
Topic: Any text editors with AHK v2 syntax highlighting?
Replies: 5
Views: 1568

Any text editors with AHK v2 syntax highlighting?

Like the title says, just wondering if anything's available ATM, cheers
by Scoox
22 Apr 2020, 10:25
Forum: AutoHotkey v2 Help
Topic: (v2) Encapsulate whole GUI and event handlers inside class?
Replies: 3
Views: 611

Re: (v2) Encapsulate whole GUI and event handlers inside class?

Guis := [CustomGui.New(), CustomGui.New()] class CustomGui { __New() { Gui := GuiCreate('', '', this) (this.EditCtrl := Gui.Add('Edit', 'w100 h100')).OnEvent('Change', 'EditCtrl_Change') this.TextCtrl := Gui.Add('Text', 'yp w100 h100') Gui.Add('Button', 'xm', 'Clear').OnEvent('Click', 'ClearBtn_Cli...
by Scoox
22 Apr 2020, 06:18
Forum: AutoHotkey v2 Help
Topic: (v2) Encapsulate whole GUI and event handlers inside class?
Replies: 3
Views: 611

(v2) Encapsulate whole GUI and event handlers inside class?

I've been wanting to write a script with multiple GUIs each having similar controls. For example, all GUIs will have an OK button and a Cancel button. My usual way of tackling this would be to give each control a unique global associated variable but the code was difficult to maintain and reuse, so ...
by Scoox
12 Apr 2020, 11:05
Forum: Ask For Help
Topic: Operators "/=" and "/" giving different results?
Replies: 2
Views: 197

Operators "/=" and "/" giving different results?

Hi guys, I'm a bit confused, here are two bits of code, both divide 1 by 10 and assign it to a variable, but the first one gives the wrong value, why?

Code: Select all

MyVar := 1
MyVar /= 10
MsgBox %MyVar% ;Displays 0

MyVar := 1
MyVar := MyVar / 10
MsgBox %MyVar% ;Displays 0.100000
Thanks :D
by Scoox
25 Sep 2019, 05:42
Forum: Ask For Help
Topic: Cannot launch Chrome from script?
Replies: 4
Views: 684

Re: Cannot launch Chrome from script?

After a system restart, everything's back to normal. Typical :facepalm: Thanks guys for your time!
by Scoox
24 Sep 2019, 09:18
Forum: Ask For Help
Topic: Cannot launch Chrome from script?
Replies: 4
Views: 684

Re: Cannot launch Chrome from script?

Thanks for taking the time to check. That's strange, I'll try on a virtual machine later.
by Scoox
24 Sep 2019, 02:38
Forum: Ask For Help
Topic: Cannot launch Chrome from script?
Replies: 4
Views: 684

Cannot launch Chrome from script?

I recently updated Chrome and suddenly I'm unable to Run, Chrome.exe from within my script. This works with the version I was using before the update. Here's the code that's not working: Target = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" Run, %Target% Nothing happens. Chrome does...
by Scoox
01 Apr 2019, 23:16
Forum: Scripts and Functions
Topic: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Replies: 103
Views: 27158

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

Just stumbled upon this and downloaded the repo, however it seems the file hotvoice.dll is missing from lib dir, script throws error message saying "unable to find lib\hotvoice.dll, exiting..."
by Scoox
24 Feb 2019, 20:35
Forum: Ask For Help
Topic: Function cannot return ClipboardAll
Replies: 8
Views: 2048

Re: Function cannot return ClipboardAll

Well yeah assigning ClipboardAll ro another variable and writing it to a file using FileAppend is all you can do with it. Having ClipboardAll and Clipboard as a variable in the first place was a mistake imo. Yeah, I would have preferred two functions, something like ClipboardGet(Mode:=0) and Clipbo...
by Scoox
23 Feb 2019, 21:05
Forum: Ask For Help
Topic: Function cannot return ClipboardAll
Replies: 8
Views: 2048

Re: Function cannot return ClipboardAll

iPhilip wrote:
22 Feb 2019, 00:00
It doesn't say that clipboard variables can be returned by a function.
... though it doesn't say clipboard variables cannot be returned either (at least I didn't find it). From your replies here this looks like a quirk + documentation issue.
by Scoox
21 Feb 2019, 22:01
Forum: Ask For Help
Topic: Function cannot return ClipboardAll
Replies: 8
Views: 2048

Re: Function cannot return ClipboardAll

iPhilip wrote:
21 Feb 2019, 11:52
As posted, it works for me, i.e. !v and ^v return hello world.
Dang! It was supposed to be MyVar := ClipboardAll, my bad. Please try again, thanks!
by Scoox
21 Feb 2019, 09:34
Forum: Ask For Help
Topic: Function cannot return ClipboardAll
Replies: 8
Views: 2048

Function cannot return ClipboardAll

[Moderator's note: Topic moved from Bug Reports.] Hi, just bumped into the following problem: !v:: Clipboard := ;Clear clipboard Clipboard := MyFunc() ;MyFunc() returns "hello world", write this string to clipboard SendInput, ^v ;Paste clipboard contents (should paste "hello world") Return MyFunc()...
by Scoox
21 Feb 2019, 08:24
Forum: Ask For Help
Topic: Clipboard working but ClipboardAll not working?
Replies: 5
Views: 975

Re: Clipboard working but ClipboardAll not working?

I'm not sure whether this can be called a bug. The ability to pass a ClipboardAll variable to y function by value was added with AHK v1.0.46. In theory the data in ClipboardAll is no different from the data any regular variable is able to store. If this works: MyVar := ClipboardAll it kind of beats...
by Scoox
21 Feb 2019, 06:22
Forum: Ask For Help
Topic: Clipboard working but ClipboardAll not working?
Replies: 5
Views: 975

Re: Clipboard working but ClipboardAll not working?

just me wrote:
21 Feb 2019, 05:48
Does the following work for you?
Yeah, that does. I was just about to say that, if I put this code inside a function, it works fine, as long as the clipboard is written to inside the body of the function. I'll use this for the time being. Do you reckon it's a bug? Thanks
by Scoox
21 Feb 2019, 06:16
Forum: Ask For Help
Topic: Clipboard working but ClipboardAll not working?
Replies: 5
Views: 975

Re: Clipboard working but ClipboardAll not working?

Further digging, there's something odd going on with functions returning (or rather, NOT returning) a value originating from ClipboardAll. Look at the following code which works: !v:: Clipboard := ;Clear clipboard Clipboard := MyFunc() ;MyFunc() returns "hello world", write this string to clipboard ...
by Scoox
21 Feb 2019, 04:06
Forum: Ask For Help
Topic: Clipboard working but ClipboardAll not working?
Replies: 5
Views: 975

Clipboard working but ClipboardAll not working?

Hi, I'm working on a hotkey that swaps the current clipboard with the prior one. This is handy for swapping words in a text with two clicks, for example, to swap the words "hello" and "autohotkey" in the following string: "hello world autohotkey" >> "autohotkey world hello". Here is my script, but f...
by Scoox
29 Jan 2019, 05:35
Forum: Bug Reports
Topic: Buggy Help (chm) file of AHK 1.1.30
Replies: 22
Views: 6066

Re: Buggy Help (chm) file of AHK 1.1.30

I have also encountered a problem with the new help file: the Ctrl+F text search box misses characters when typing very fast, so for example if I type "hidden" only "hiddn" or "hidde" is registered. Has anyone else noticed this? No, I couldn't reproduce this issue (tested on Win10/IE11 and WinXP/IE...
by Scoox
28 Jan 2019, 19:46
Forum: Ask For Help
Topic: GetKeyState("Insert", "T") returning wrong toggle state
Replies: 2
Views: 936

Re: GetKeyState("Insert", "T") returning wrong toggle state

Thanks swagfag. Was just googling this and this came up: I note that the Insert key, unlike Caps-Lock and Num-Lock, does not have a systemwide state, and it varies per-application or even per-control. I believe (though am uncertain) that maintaining the state of the Insert key is your responsibility...
by Scoox
28 Jan 2019, 19:13
Forum: Bug Reports
Topic: Buggy Help (chm) file of AHK 1.1.30
Replies: 22
Views: 6066

Re: Buggy Help (chm) file of AHK 1.1.30

I like the new help UI but there's one thing which was definitely better in the old help. First, a bit of background. I have configured my new help file to select the Index tab when it starts ( Gear icon > Selected Tab = Index ). In the old help there was no such setting—it would simply remember the...

Go to advanced search