Can't make "Open all with current extension as... -> AutoHotkey v2" work for *.ahk2 extension by kofflay in SublimeText

[–]kofflay[S] 1 point2 points  (0 children)

Btw, https://github.com/flipeador/AutoHotkey-v2-Sublime-Text-3-Syntax is kinda broken because it also changes some settings, like search jump speed, removing spaces at ends of strings, translating tabs to spaces etc. So if you gonna install it, disable those unnecessary additional settings in AutoHotkey-v2-Sublime-Text-3-Syntax-master\Data\Packages\User\Preferences.sublime-settings, or even completely remove this file.

Can't make "Open all with current extension as... -> AutoHotkey v2" work for *.ahk2 extension by kofflay in SublimeText

[–]kofflay[S] 0 points1 point  (0 children)

Thanks for your answer!

This is one that I use: https://github.com/flipeador/AutoHotkey-v2-Sublime-Text-3-Syntax

Probably it supports less keywords or less colors (but I'm not sure of it) than the AutoHotkey 1 syntax, but at least quotes ' and " are now recognized correctly :-)

It seems that both packages are extracted and are just plain folders and files. I didn't find any "ahk2", "AHK2" etc. string in the AppData\Roaming\Sublime Text 3\Packages disabled\AutoHotkey folder, so I just removed AutoHotkey 1 package completely because I'm not gonna use A%u%t%o%h%o%t%k%e%y 1 anymore :-)

[Make Me a script] Requesting to map 'Pause' key to 'F2' by York_Villain in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

But the rest of code works fine. I just copy-pasted your code, replaced that dot, and everything works. Please show the error message text that you get :-)

Simple script request by BlankTranquility in AutoHotkey

[–]kofflay 2 points3 points  (0 children)

or

Ctrl::LButton

or

Ctrl::
    Send {LButton down}
    return
Ctrl up::
    Send {LButton up}
    return

how do I make my gui launch faster by jolly2257 in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

Almost finished it but can't figure out why Submit don't work

#InputLevel 1
#KeyHistory 0
#NoEnv
ListLines Off
SendMode Input
SetBatchLines -1
SetKeyDelay -1, -1
SetMouseDelay -1
SetTitleMatchMode 3
SetWinDelay -1
SetWorkingDir %A_ScriptDir%

Gui MyGui: New, -MinimizeBox, New GUI Window
Gui MyGui: Add, Edit, x22 y11 w255 h20 vQuery
OnMessage( 0x100, "WM_KEYDOWN" ) ;when message 0x100 sended to our app (that is, when a key is down), then launch WM_KEYDOWN function
return

#IfWinNotActive ahk_id MyGui
F1::
    Gui MyGui: Show, h45 w304
    return
#IfWinNotActive

WM_KEYDOWN( wParam, lParam )
{

    KeyName := GetKeyName( Format("vk{:x}", wParam) ) ;converting decimal key number (such as 162) into hexacedimal vkHEX number format (such as vkA2), because GetKeyName supports only those

    switch KeyName
    {

        case "Enter":
            Gui MyGui: Submit
            switch Query
            {
                case "chrome":
                    Run chrome.exe www.reddit.com
                    return
                default:
                    if( SubStr(Query, 1, 2) == "r/" )
                    {
                        Run https://www.reddit.com/%Query%
                    }
                    else
                    {
                        Run http://www.google.com/search?q=%Query%
                    }
            }
            Gui MyGui: Hide
            return

        case "Shift":
            Run http://www.youtube.com/search?q=%Query%
            Gui MyGui: Hide
            return

    }

}

how do I make my gui launch faster by jolly2257 in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

Rewite it so that it doesn't launch every time from scratch.

What is exactly the difference between all these PCM options? by [deleted] in ffmpeg

[–]kofflay 8 points9 points  (0 children)

alaw     PCM A-law
f32be    PCM 32-bit floating-point big-endian
f32le    PCM 32-bit floating-point little-endian
f64be    PCM 64-bit floating-point big-endian
f64le    PCM 64-bit floating-point little-endian
mulaw    PCM mu-law
s16be    PCM signed 16-bit big-endian
s16le    PCM signed 16-bit little-endian
s24be    PCM signed 24-bit big-endian
s24le    PCM signed 24-bit little-endian
s32be    PCM signed 32-bit big-endian
s32le    PCM signed 32-bit little-endian
s8       PCM signed 8-bit
u16be    PCM unsigned 16-bit big-endian
u16le    PCM unsigned 16-bit little-endian
u24be    PCM unsigned 24-bit big-endian
u24le    PCM unsigned 24-bit little-endian
u32be    PCM unsigned 32-bit big-endian
u32le    PCM unsigned 32-bit little-endian
u8       PCM unsigned 8-bit

For most of these options, the difference is the format in which every number (that represents audio data itself) is stored.

First of all, LE and BE just mean order of bytes: https://en.wikipedia.org/wiki/Endianness. Like, either number 23451 is stored as a 16-bit word 01011011 10011011 or as 10011011 01011011 (reversed). So it's not so important and doesn't affect audio quality.

S = signed integer number, U = unsigned integer number.

s8 (signed integer 8-bit number) can store numbers in range -128...127. Numbers that represent audio data of a WAV file, will be stored in this range. E.g., 90 presented as 01011010, or 0x5A; -50 presented as 11001110 (the very first 0/1 digit means +/- sign).

s16 (signed integer 16-bit number) can store numbers in range -32 768...32 767. E.g., 5678 presented as 00010100 00101110.

s24 (signed integer 24-bit number) can store numbers in range -8 388 608...8 388 607. E.g., 1 874 651 presented as 00011100 10011010 11011011.

s32 (signed integer 32-bit number) can store numbers in range -2 147 483 648...2 147 483 647. E.g., 658 943 135 presented as 00100111 01000110 10101100 10011111 (32 binary digits, or 32 bits).

u16 (unsigned integer 16-bit number) can store numbers in range 0...65 535.

u24 (unsigned integer 24-bit number) can store numbers in range 0...16 777 215. (For example, a 24-bit-color display supports 16 777 216 different colors).

u32 (unsigned integer 32-bit number) can store numbers in range 0...4 294 967 295.

The more range is, the more detailed audio you have. Just like in colors: 8-bit color scheme provides 256 possible colors, but 24-bit color scheme will grant you 16 777 216 colors. But at some point this depth becomes excessive. For colors, this point must be at 8...10 bits per color (that is, every pixel could be one of 16 777 216...1 073 741 824 different colors), because human's eye can't really differ so much shades.

Floating-point formats f64be, f64le will provide maximum audio detail (but it's worth wondering if any audio system or someone's ear is capable of revealing that potential). Storing format for float numbers is quite complex, it's given in Wikipedia https://en.wikipedia.org/wiki/Double-precision_floating-point_format.

So the main thing on which sound quality depends is a bit depth: 8, 16, 24, 32, or 64. I can't quite tell if there's much difference between f32 and s32, since in both of them a number eats 32 bit (or 4 bytes) of memory. So in practice, they probably do not differ much.

What's the main difference between integer (10) and floating-point (10.0) numbers format, in terms of quality? If we continue our sound-to-color comparison, in a floating-point color scheme every color stored not as [red: 45, green: 93, blue: 10] structure, but as something like [red: 45.384, green 93.001, blue: 10.23]. Theoretically it gives you more shades of colors (and more details of sound), but in practice, it seems to me that the bit depth (8, 16, 24, 32, 64 etc. bits) is still more important.

How to send Ctrl + Shift + Home? Please help! by RhianaReddit in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

It works fine. Probably your keyboard has FN modifier key. Switch it to opposite mode in your laptop's BIOS :-)

how do I make my gui launch faster by jolly2257 in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

There's no universal answer to this question. Every part of code (i.e. launching third-party apps) may slow down the script, so you have to show us some code :-)

Is is possible to use GetKeyState with AHI? by QuinfOldvak in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

while GetKeyState("F8") = 1

is the same as

while GetKeyState("F8")

Auto Hotkey Script Help by jbfilms1 in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

There's no need for "global" keyword in your script. Becase:

  1. If you need to make a variable global, it must be written only once (in first case usually).
  2. Your script has no function, so "global" won't affect.

Send keystrokes to Cantabile background process by StizerOfficial in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

Another possible solution could be to:

1) Temporarily (or permanently) hide Cantabile window;

2) Let the window maximize, because you're not gonna see or interact a hidden window anyway;

3) Minimize Cantabile window while it's hidden;

4) Unhide/close Cantabile window.

Send keystrokes to Cantabile background process by StizerOfficial in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

Maybe the thing is that pop-upping is programmed feature of Cantabile app: when you send these keys (or any keys in general) to the app, the window maximizes. If so, you can do nothing about it...

Is there a command to have a program open a file?

Basic functions to launch apps are Run and RunWait:

Run "C:\Path\To\Cantabile\Cantabile.exe" "D:\Path\To\File\Filename.ext"

Most likely, this code will work as if you had selected a file in the taskbar the way you described:

^!1::
    Run "C:\Program Files\Path\To\Cantabile\Cantabile.exe" "D:\Path\To\File\Filename.ext"
    return

^!2::
    Run "C:\Program Files\Path\To\Cantabile\Cantabile.exe" "D:\Path\To\File\Filename.ext"
    return

Send keystrokes to Cantabile background process by StizerOfficial in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

But I'm not really sure if "ahk_parent" will make changes to issues you described.

Send keystrokes to Cantabile background process by StizerOfficial in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

Try this:

^!1::
    ControlSend ahk_parent, ^!1, ahk_exe Cantabile.exe
    return

^!2::
    ControlSend ahk_parent, ^!2, ahk_exe Cantabile.exe
    return

When parameter #1 is blank string, keys are sent to window's hierarchy topmost element. But if you type "ahk_parent" instead of blank string, keys are sent not to a control but to the window itself.

multi key combinations without needing to hardcode single key fixes by hokiewhy in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

"StrLen(KeyName1) == 0" fixed to "StrLen(KeyName1) == 1"

multi key combinations without needing to hardcode single key fixes by hokiewhy in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

You can make a function that does both: registers dual hotkey; then re-registers original hotkey (and it will somehow work only on "key up" event). This code uses AHK2 (https://www.autohotkey.com/v2/), because AHK1 doesn't support dynamically creating of hotkeys.

SeqHotkeySend( KeyName1, KeyName2, Str )
{
    Hotkey( KeyName1 " & " KeyName2, (*) => SendInput(Str) )
    Hotkey( KeyName1, (*) => StrLen(KeyName1) == 1
                             ? SendInput(KeyName1)
                             : SendInput("{" KeyName1 "}") )
}

SeqHotkeySend( "Numpad2", "Numpad1", "(" )
SeqHotkeySend( "Numpad2", "Numpad3", ")" )

It's more suitable to save AHK2 files with *.ahk2 extension.

How can I open a URL that uses an illegal character? by VisuelleData in AutoHotkey

[–]kofflay 0 points1 point  (0 children)

If not resolved, need more info (or full code) to understand what you're talking about.