| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Thu Apr 21, 2005 11:38 pm Post subject: Keypress based off log file? |
|
|
Hello,
I was wondering if there was a way to execute a keypress based off the last line in an automatically updated log file. I have another macro that is doing all the dirty work for me. All I want to do is have 'r' pressed any time a customer sends me a request..
I tried to do a search on the forums but nothing that quite hits the nail on the head. I am pretty sure I am going to have to use the program 'Tail' (sp?) to parse the log file (then again I dont know anything about it, but it looks like that is what it does).
Sorry if this question has been answered numerous times before; I am by no means a 'good' programmer so ANY help or suggestions would be very much appreciated. THANKS IN ADVANCE!! |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Apr 22, 2005 6:51 am Post subject: |
|
|
Sounds like to decrease a trouble ticket systems response time.
| Code: | Loop, Read, My.log
{
LastLine = %A_LoopReadLine%
}
If LastLine contains Gehaltserhöhung
{
MsgBox, Schon wieder eine Gehaltserhöhung. Press: Akzeptie[color=red]r[/color]t !
} |
Gehaltserhöhung = salary increase
btw: Are you allowed to cut off the log (as the above code reads an increasing inputfile again and again) ? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Apr 22, 2005 12:33 pm Post subject: |
|
|
| Code: | Loop
{
FileGetTime, CurrModTime, My.log, M
If CurrModTime = %PrevModTime%
Continue
PrevModTime = %CurrModTime%
MsgBox, File has been manipulated at: %CurrModTime%
} |
|
|
| Back to top |
|
 |
ludachris
Joined: 21 Apr 2005 Posts: 2
|
Posted: Fri Apr 22, 2005 1:36 pm Post subject: |
|
|
| BoBo wrote: | Sounds like to decrease a trouble ticket systems response time.
| Code: | Loop, Read, My.log
{
LastLine = %A_LoopReadLine%
}
If LastLine contains Gehaltserhöhung
{
MsgBox, Schon wieder eine Gehaltserhöhung. Press: Akzeptie[color=red]r[/color]t !
} |
Gehaltserhöhung = salary increase
btw: Are you allowed to cut off the log (as the above code reads an increasing inputfile again and again) ? |
Pardon my ignorance - Is there any way you can post this in English? The log file would actually never be cut off, it would just have lines appended to it. Would the above code continue to press 'r' if the last line contains (in your example 'salary increase')? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Apr 22, 2005 1:58 pm Post subject: |
|
|
| Code: | Loop, Read, My.log
{
LastLine = %A_LoopReadLine% ; keep the content of the last line
}
If LastLine contains MyKeyword ; replace "MyKeyword" with your string pattern
{
Send, r ; sends the charcter "r" to the app/file which has the focus
} |
|
|
| Back to top |
|
 |
ludachris
Joined: 21 Apr 2005 Posts: 2
|
Posted: Fri Apr 22, 2005 3:54 pm Post subject: |
|
|
THANK YOU THANK YOU THANK YOU THANK YOU...
THANK YOU!!
I am going to try this as soon as I can |
|
| Back to top |
|
 |
|