accessible, but out of tabstop sequence - autohotkey

Is there a way to get an edit control accessible, but out of the tabstop sequence? Eg I have
Gui, Add, Text, &a
Gui, Add, Edit, -Tabstop ReadOnly
I cannot tab to it (which is good) but i also cannot use alt-a to reach it nor can I reach it by mouse clicking it. This is a problem as the user cannot scroll and peruse its contents.
If one changes the - to a + one can reach it by tabs and alt-a. However I do not want it to be in the tabstop sequence. From the "GUI Styles" page of the AutoHotkey Help/manual these appear to be the only relevant styles for an edit command...
How can I have that control reachable, but outside the tab sequence?

If you turn Alt-a into a hotkey, this is how you get the requested result
Gui, Add, Text, ,&a
Gui, Add, Edit, -Tabstop Readonly vMyEdit, My Content
Gui, Add, Edit
Gui, Show
return
!a::
GuiControl,focus, MyEdit
return

Related

InputField Component: A scripts runs On End Edit (string), how do we know in that script if we submitted the inputfield vs simply clicking another UI

So I know I can call InputField.wasCanceled from within my script to tell if ESC was pressed to cancel.
However, take the case where you enter some text in the inputfield (without pressing enter or ESC) and then immediately click another unrelated button in the UI. In this case the On End Edit (string) will still trigger and our script will be run, however InputField.wasCanceled is showing as FALSE in this case.
So I have not found a way to differentiate between if we press ENTER to trigger the On End Edit, or if we simply click on a different piece of UI. I want to treat these 2 cases differently so am wondering if there is another way?

How to enable the maximize button in the gui?

When i create a GUI her maximize button is grayed out/disabled, how can i enable it?
Example:
Gui, Add, Button, w100 h30, Button
Gui, Show, w400 h300
I was reading the docs and found this parameter Maximize: Maximizes and activates the window.
It does maximize the GUI as soon its launched:
Gui, Show, Maximize w400 h300
However, i would like to enable maximizing/restoring upon clicking the maximize button.
You need to add the flag +Resize
From docs:
Resize: Makes the window resizable and enables its maximize button in the title bar. To avoid enabling the maximize button, specify +Resize -MaximizeBox.

Multiple keystrokes as autohotkey shortcut

I'm new to AutoHotkey.
I have a specfic need to be achieved in Powerpoint using autohotkey.
Let's say in Powerpoint, I want to change font color.
The normal steps are:
Select the text
Click "Home" > Click "Font Color" > The Font palette gets expanded and I select the color.
Now, I want to make this process quicker as below
Select the text
Press FC (as shortcut from keyboard) and autohotkey should press the following keys Alt+H+FC (Very importantly, if I don't press C immediately after F, then it should get typed as replaced text of highlighted text)
So, my code goes as like this
#SingleInstance, Force
#IfWinActive ahk_exe POWERPNT.EXE ; check whether ppt is the active window
f::
#if keypress c
send, !HFC
#if
return
But, this doesn't work.
I don't where am I making mistake. Could someone help, please
I know this is an autohotkey question, but the quick access toolbar (QAT) in PowerPoint may solve your problem out of the box.
The QAT assigns Alt+1 to the first feature, alt+2 to the second, etc. By customizing the order of buttons on the QAT, you can access features you use often with one key combination.
Instructions
First add the font color button to the QAT: right click the 'font color' button, and click 'add to quick access toolbar'
Change the order of features in the QAT: right click on the QAT - customize quick access toolbar). Use the arrow buttons on the right side to change the ordering.
This is the order I use myself:
This allows me to very quickly align objects on a slide, change background color, outline, and text color, all initiated from the keyboard.

I don't know how to go about a button to open a website

I have a couple of questions, I'm making a personal/public tool for finding and opening external tool websites really quick, in the code (Which I will provide below) I want to have buttons with the text on them with the website, the links and names of each website are in the code at the bottom of the GUI Stuffs.
I just don't know how to go about the button and text thing, nor do I know how to open a website in chrome externally I know how to do it in a batch file, but not in AHK
; This is an ED tools Program built to allow you to open tools with a click of a button
Gui, Show, w310 h300, Elite Dangerous Tools
; GUI Stuffs
Gui, Add, Button, w50 19 x150 y10 Beddb
;Tools
;eddb.io
eddb:
return
;-----------
;www.edsm.net
edsm:
return
;-----------
;inara.cz
inara:
return
;-----------
;coriolis.io
coriolis:
return
;-----------
;edtools.ddns.net
edtools:
return
;-----------
;edshipyard.net/
edship:
return
;-----------
GuiClose:
ExitApp
I want to have a GUI with buttons on it, 6 buttons in total. 3 on each side, text saying the name of the website, whatever. but when I run it now, I get
Error: Invalid Option
Specifically Beddb
Line#
006 Gui,Add,Button,w50 h19 x150 y10 Bebbd
As Yane mentioned in the comment, you need a g before your sub-routine (label) name. (More info here.) Below is a working example of your code for one of the buttons and sites. It opens the site in Firefox. You can apply this to the rest of your buttons and sites.
f1::
Gui , Add , Button , w50 19 x150 y10 geddb , eddb.io
Gui , Show , w310 h300 , Elite Dangerous Tools
Return
eddb:
Run , firefox.exe "eddb.io"
Return
The help documentation does a great job explaining all the things you can do with GUIs.
https://www.autohotkey.com/docs/commands/Gui.htm

In notepad++ change tab size instantly

I'm using notepad++ (v6.5.3) and I constantly have to change the size of the tab for viewing some results. Not that it's taking me a lot of time to do it manually everytime, but it would be great if I could optimize that.
Is there a way to do so? Would a macro be the solution, or are they just for typing stuff?
Thanks a lot!
Ok, there's an easy way how you can achieve this - I have tested it right now:
Install AutoHotKey (or start portable version which runs without installation)
In Windows 7 and above, ensure you launched AutoHotKey as Administrator (otherwise you get inconsistencies in its behavior) - if not sure, exit it and restart it as administrator
Right click Autohotkey tray icon and select Edit This Script
Import the macro below this list at the end of the AutoHotKey script file and save the file
Right click Autohotkey tray icon and select Reload This Script.
–– This was end of general steps, now let's go with your macro: ––
In N++, display Preferences window and press its Close button1 at the bottom (NOT at the top-right corner)
Now you can use shortcuts Win+F2 and Win+F3 to switch different tab sizes instantly
SendMode Input
DetectHiddenWindows, On
SetTitleMatchMode, RegEx
;--------------------------------- Hotkeys for Notepad++ only
#IfWinActive ahk_class Notepad\+\+
#F2::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}16{Enter}{Tab 3}{Space}
#F3::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}4{Enter}{Tab 3}{Space}
#IfWinActive
1) Important: N++ user experience provided in dialog boxes is absolutely terrible. There are no anchors where you can fix focus when using keyboard. Thus you always need to perform step 4 manually when leaving Preferences dialog box otherwise the macros would send keys into incorect window page OR at correct page but incorrect control. Preferences dialog window remembers selected page and control. Macros I created for you therefore assume that correct page is already listed and button Close was recently focused.
Good news is Notepad++ windows with this weird behavior are rare exception from general user experience. In other places in N++ (or in other apps) where user interface components (menus, dialogs etc.) always start from the same point you do not need any special precautions like the one in step 4.
Adjust the macros as you like:
you can create more of them
you can adjust the numbers "16" and "4" typed into tab size input box
you can change shortcut keys to something else
you can replace sending keys with sending mouse clicks at desired screen/window positions
you can achieve many other useful shortcuts in N++ and in all other apps – check AHK deeper!