Awesome, TYVM
SendMessage / PostMessage are probably one of the most fantastic features of AHK - If you are unfamiliar with them (I am at best noob myself) they are well worth spending a few days learning.
Basically you can use SendMessage to communicate / call functions in other scripts / processes. PostMessage is similar, but only in the outgoing direction.
An axample would be as above - I run a #persistent script containing your OCR functions, with an OnMessage function, that returns the value from the OCR function.
The script wanting to OCR something fires a SendMessage to the OCR script, and recieves response from OCR script.
That is probably not very clear
A decent example is the way BetPot can SendMessage TableNavigator for the ahk_id of the currently highlighted table - that is done with the TableNav function in BetPot and the OnMessage 0x5555(I think) function in tableNavigator.
Very useful feature, allows AHKs to communicate with other AHKs / probably any other app
EDIT: Sendmessage is pretty much the only method for inter-script communication - and relies upon the existance of an OnMessage handler function in the receiving script - unless the sent message is low-numbered enough to be a standard Windows message.
dave.