[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

A major(?) discovery for XyWriters



I make heavy use of Autohotkey, which I enthusiastically recommend for
scripting and macros. Today I discovered that Xy can run Autohotkey
scripts, with no fuss.

Just use this:

dos/nv/x/z /c cmd.exe /c start {your filespec here}

Autohotkey scripts must have an .ahk extension.
You can do just about anything in Windows using .ahk scripts. With just a few lines of code, I created an extended Clipboard that saves all the selections I ever Copy in one file. Autohotkey handles that for copying in non-XyWrite programs and XyWrite calls AHK to do it for XyWrite copied clips.
The current clip is stored in C:\Dropbox\Xy\C.TXT and the running total in
C:\Dropbox\Xy\COLD.TXT. (I pre-pend each added clip with a time-date-stamp).
Another thing you can do is have XyWrite make sounds. I was used to hearing
the sound of a popping cork (in Windows, outside of Xy) when I copied. Now
I get it when I copy in Xy, also, through this line of AHK code:

 SoundPlay C:\Dropbox\BestCorkPop.wav
No doubt you can do all this with Visual Basic and Python, but the nice thing about AHK is that it is keystroke driven--and it's simple syntax. We're familiar with that from customizing the XyWrite .kbd file. Combining the two, you could have:

nn=dos/nv/x/z /c cmd.exe /c start c:\AHK\corkpop.ahk [commas ommitted here]

where corkpop.ahk has the above SoundPlay line in it.
Though that is a fairly useless key assignment, many wonderful things are possible from AHK scripts. My all-purpose AHK file now runs to 1400 lines of code, with application-specific assignments of the same keystroke (e.g., ^5 can mean different things in XyWrite, Excel, Paint, etc.).