Well there's a lot of autohotkey sites saying that you can apply a transparency and then capture special mouse events to emulate the mouseover and mouseout effects of a button with an image as a background.  I couldn't get any of these working and they looked more confusing then anything else.

My solution is to set up the default button and the image to respond to the ENTER key after you typed something (this is for a search feature) in addition to having a button if the user would rather click then press the ENTER key.  Then create the mouseover and mouseout effects afterwards.

 In this case, I want to display the current month with today highlighted.  As I was trying to get my head round writing this in a program using the qHTM.dll (to include HTML in an autohotkey GUI), the calendar will be in a HTML-autohotkey mixed code.  Obviously just omit the HTML rubbish if you want to create a calendar using just autohotkey syntax.

Actually, the following code is an excerpt from my program which checks an online server (for IT Events during this month) and if it can't download the calendar, it had to display an offline version in the GUI.  To display the following code in this website though, I've had to omit a lot of the HTML part.

Just a quick note for the moment on how to use ternary operators in AutoHotkey.  A ternary operator for those who are unfamiliar with this is an "If...Then...Else..." statement written in a small amount of code, usually on one line, and exists in most programming languages.

For Example, the statement:

 

If (ThisCondition = true)
    ThisVar:=1
Else
    ThisVar:=2

Converted to Ternary this would look like:

ThisVar:=(ThisCondition = true) ? 1 : 2
I'll add as there are a whole bunch of methods using the Ternary Operator in AutoHotkey (discussed on http://www.autohotkey.com/forum/topic29752.html) which I'll put in soon. I just needed something on my site now as I find myself looking for this bit of info every now and again.

Applies to:

  • Microsoft Windows 7 Professional
  • Ms-DOS Command Prompt (6.1.7601)

What?
A quick article on how to rename multiple files using the command prompt and a bit of string manipulation. This example will rename files which contain the string " (Copy)" and replace it with nothing (so removes it). The challenge here is the space character and delimiting by a string.

The Gist
-- What I have
Image00001 (Copy).jpg
Image00002 (Copy).jpg

-- What I want
Image00001.jpg
Image00002.jpg

How?
Before I continue, the undo may work in MS Windows (Control key + Z) but don't count on it. I'm going to use a short batch process but to save time on the different ways of doing this, the example below uses a command prompt to a) create a batch file b) use it to rename the files c) delete the batch file.

Subcategories