What do you use AHK for?

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

Post by SOTE » 17 Nov 2020, 18:08

malcev wrote:
16 Nov 2020, 18:14
For example this topic
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=83224
Ahk does not have bluetooth wrapper.
Therefore Topicstarter has 3 choices.
1) Read msdn, count sizes of structures and write wrapper by himself
2) Use imagesearch popular solution of any problem :)
3) use python library with examples
https://github.com/pybluez/pybluez
In regards to this example that you gave about bluetooth, where the user simply wants to open a control panel and select the correct headphone, throwing them to a bluetooth Python library could be beyond complexity overkill. From their simple code, such a Python library would likely be very problematic, not to mention the massive setup headache.

What's best for a casual or intermediate coder, might not be the same as for an advanced coder. And even for an advanced coder, there can be several ways to solve a problem, and which route taken depends on preference.

From this simple code...

Code: Select all

#SingleInstance,force
NumpadPgDn:: ;3 on Numpad
Run, bthprops.cpl
Sleep, 2000
Send, {tab}{tab}{enter}{tab}{enter}
Sleep, 200
Send,!{Tab}
return
This could have been solved by telling the casual coder that they can easily increase the Tab count sent, so that focus is on the correct place.
Note- ControlSend or ControlClick might possibly work too.
Send {TAB 6}
https://www.autohotkey.com/docs/commands/Send.htm#Repeating_or_Holding_Down_a_Key
(Repeating_or_Holding_Down_a_Key)

The next level of escalating complexity, would arguably have been to have them use the built-in ImageSearch, which clearly you also knew. That would have also solved their problem. Maybe, if you wanted to be fancier about it, could have them convert the .jpg image to Base64, so that that no external file is needed or possibly point them to/show them FindText as well.

https://www.autohotkey.com/docs/commands/ImageSearch.htm
(ImageSearch)

https://www.autohotkey.com/boards/viewtopic.php?t=35964
(Base64 encoder/decoder for Binary data)

https://www.autohotkey.com/boards/viewtopic.php?t=17834&p=86799
(FindText by FeiYue)

Another possibility could have been something dealing with AHKHID
https://github.com/SBRK/bluetooth-windows-play-pause-ahk
(bluetooth-windows-play-pause-ahk)
(script for having the play/pause of bluetooth wireless headphones work in Windows)

Also, if we dig a bit deeper into that Python Bluetooth library, very likely some C/C++ code will reveal itself. Meaning that an AHK coder or group of coders could do similar in creating such for AutoHotkey. There are also a number of scripts dealing with Bluetooth, doing DllCalls to bthprops.cpl, etc...

User avatar
Jovannb
Posts: 268
Joined: 17 Jun 2014, 02:44
Location: Austria

Re: What do you use AHK for?

Post by Jovannb » 28 Dec 2020, 18:56

Hi

a) central organizing project numbers (app. 140 per year) smb-company
b) compress pictures for all users, on their demand to a certain size (iterativ processing)
c) log all files on your server every night, write result in a database to know when new files (above a threshold size) are made, deleted or moved
d) communicate with an external WSDL-Server via SOAP (engaging curl)
e) export calendars from local-users-Outlook to a centralised table, shown to all users
f) send an receive internal notes company wide, send and receive them in parallel via SMS on/from smartphones, store them in a central database
g) handle all our company-wide-addresses
h) change outlook-email-senders address depending on subject-content of an outgoing email on every computer in our network
i) detect and log which user is on our system via VPN
j) change update cycles of our own applications when connected via VPN or via cables
k) handle all templates company-wide
l) select files via Totalcommander, zip-them-together, put them on an external server and create al https-Link (into clipboard) for our users to sent this link to our partner/customers for all Email-attachment-packages e.g. with more than 1 MB (saving space in outlook), deleting those uploaded files automatically after a certain time (per upload definable by uploader/user)
m) check my server every night and get size of every project-directory which we use and show it to our users on their demand
n) inject former vba-macros via ahk into excel as vba-marcos, start them, delete them afterwards, so you have nothing to install on every excel installatione
o) fullfil winword-templates by ahk with values from an excel-sheet
p) beep when a user logsin/out form our time-stamp-system which is web-based
q) managing usb-media for server backup (mo,tu,we,th,fr1,fr2,fr3,fr4, mon1...)
and many others

J.B.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german

Post Reply

Return to “General Discussion”