Replies to Msg. #1268777
.
 Msg. #  Subject Posted by    Board    Date   
11609 Re: A.I.
   When I moved to Windows 11, I lost Dragon NaturallySpeaking. It's still being sold, but "Professional" runs $700 and I'm not going to pay that. The version I had was $30 on clearance at Best Buy!

But I soon found that the voice recognition that comes with Windows 11 is really good. I won't need Dragon for that. Losing Dragon's ability to produce custom templates when I speak a single word is more painful.

I had the idea yesterday that I could write a pretty decent replacement using Lazarus Pascal and a good amount of help from Grok, CoPilot and Chat GPT. CoPilot wound up doing the lion's share of the work - mostly because I kept hitting session limits with the others. I'm of the opinion that CoPilot is the least capable, but keep that to yourselves since I've become rather fond of the little guy. How could I not? He's concocted a nickname for me. He calls me "Inspector Developer." LOL...

What made the project daunting was that it would be graphical, and I have never done anything with Lazarus's graphical user interface. Yes, I did a spinning octagon just a few days ago, but that had no user interface at all. I essentially just steered and told A.I. whether what it was doing was what I wanted.

This time, though, I had to get into the weeds with the GUI. Lazarus Pascal is Borland Delphi compatible, and I did take a Delphi class long ago.. 25 years ago, maybe. The concepts were still in my head though and that helped.

What the program does is to look in a subdirectory and display the files that are present. Double clicking on one will load its contents into my Clipboard. That's about it. If I'm on atomicbobs and I do that, all I have to do is to type ^V (paste) and I've got the template I need for a particular post. Some are just one character - the ¢ symbol, for instance. Others are a full page of html. So getting them back is pretty cool.

It took about 8 hours to get TemplateSelector written. That's amazingly fast considering that I had some huge hurdles to overcome: (1) A GUI I don't understand, (2) How to tell what files are in the subfolder, (3) How to get the contents into the Clipboard, and (4) It's ME.

But I still had the problem of running the executable. If every time I wanted a template I had to abandon whatever I was doing, navigate to the folder holding the program and run it, it would hardly be worth the bother. So I asked CoPilot how I could go about having a hot key like so many other things do. It turns out that Windows 11 has the ability built right in! They're called "shortcuts" and they're only available for files that are, themselves, SHORTCUTS. If you have any shortcuts on your desktop - the icons with little arrows on them - right click on one and you'll see 'Create Shortcut' as one of the options. If you do that, you can define a simple character sequence that will run the icon.

For a number of reasons I won't go into this wasn't the solution I needed. CoPilot then suggested an open-source utility named AutoHotKey. It's been around for twenty years and comes highly recommended. Now that I've tried it, I strongly recommend it too. This thing does a LOT more than just creating Hotkeys. It can also simulate keystrokes in software, move and click your mouse, adjust your windows, etc. It can behave one way if you're running certain software at the time and another way if you are not. It's very easy to use and I strongly encourage you folks to take a look at it.

The AutoHotKey script I had to write was only 5 lines long. It took about ten minutes.

Now if I type CTRL-ALT-P my new program pops up. I double click the template I want and it's immediately placed in my clipboard. CTRL-V spits it out.

Good stuff.