Jump to content

bqbowden

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by bqbowden

  1. A few jobs back, we used a product called Automate (Automate Link)) which is very similar to AutoIT. It has a lot more features and I believe is a bit easier to code. This may fit your needs. I know when we used this product, we were able to learn it quickly and it allowed a lot of flexibility. Barry
  2. I am so stupid - "@ScriptDir" was adding extra stuff to the path so OF COURSE it would never find it. So, the "@ScriptDir" command puts in where the script is running from. Thanks a lot for pointing me to this. Barry
  3. Here is the script I have been running to test another phase of this project. It uses the same filename and works with no problem. It is using a different command but the file is the same. ; === VARIABLE DECLARATIONS === ;$file = Mozilla Thunderbird Inbox for all messages from my MSN account $file = FileRead("C:\Documents and Settings\Barry Bowden\Application Data\Thunderbird\Profiles\8xdu7029.default\Mail\pop3.live.com\Inbox") & @LF $total = Amount($file,"new voice message") $Mother = Amount($file, "919-575-4175") $Dad = Amount($file, "919-906-3060") $Other = $total - ($Mother + $Dad) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf If $Total < 0 Then $Total = 0 MsgBox(0, "VM Count", "Total VMs = "& $Total & @CRLF & "Mother = " & $Mother & @CRLF & "Dad = "& $Dad & @CRLF & "Other = " & $Other) Exit ;=== FUNCTIONS === Func Amount($string, $search) Local $aCount = StringRegExp($string, ".*(?i:" & $search & ").*\n", 3) Return (UBound($aCount)) EndFunc
  4. Omikron48, I will give this a try. I have validated the file path name and know that is correct because I use the same path in another script I wrote. But it may be getting truncated for some reason in this script. I will let you know what happens. Barry
  5. Well, after several hours of tweaking, the above script PsaltyDS was kind enough to give me is not working and I have no idea why. Here is the code and some sample data. #include <File.au3> #include <Array.au3> Global $sDateTime = "X-OriginalArrivalTime: 07 Mar 2011 21:08" Global $sLogFile = @ScriptDir & "C:\Documents and Settings\Barry Bowden\Application Data\Thunderbird\Profiles\8xdu7029.default\Mail\pop3.live.com\Inbox" Global $aLogData[1], $iIndex ; Find Date\Time stamp _FileReadToArray($sLogFile, $aLogData) $iIndex = _ArraySearch($aLogData, $sDateTime, 1, 0, 0, 1) If @error Then MsgBox(16, "Error", "Failed to find Date\Time stamp: " & $sDateTime) Exit EndIf ; Display seven lines after Date\Time stamp $iIndex += 7 If $iIndex <= $aLogData[0] Then MsgBox(64, "Data line", $aLogData[$iIndex]) DATA ============================================================== To: FIRST NAME LAST NAME <bqbowden@msn.com> Return-Path: noreply@timewarnercable.com X-OriginalArrivalTime: 07 Mar 2011 21:08:07.0775 (UTC) FILETIME=[C1E796F0:01CBDD0B] --uVoice_BND4D754936615238 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mailbox 919-529-4460 has a new voice message from Unknown Name (919-575-4175). Length: 17 seconds Received on: 03/07/2011 04:08PM (EST) DATA ============================================================== Why is the search failing to find the text? Barry
  6. Great, thanks. I am not sure I understand everything I am looking at, but I will pick it apart. This will help. Barry
  7. Can compiled code be ran on an iPad?
  8. So in AutoIt there is a position [0] in their arrays? That is why it was giving me errors. If I do not put a value in [0] will that cause me problems later? I knew it was something simple. Thanks iamtheky for the help.
  9. I am working on a script to search a text file but I cannot seem to come up with the code to do what I need. When an event happens, it has a time stamp. So I get the date and time stamp and search for that string in the file. Once I have it, I need to go down lines and pull the entire line. I will then pull the numbers at the end of this line. The problem I have is I do not know how to go down the seven (7) lines then get just the line with the numbers I need. Here is an example of the raw data I am searching for ... =========================================================================================================== Return-Path: noreply@timewarnercable.com X-OriginalArrivalTime: 05 Mar 2011 20:10:34.0099 (UTC) FILETIME=[6286F430:01CBDB71] --uVoice_BND4D7298B9127949 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mailbox 919-529-4460 has a new voice message from Unknown Name (919-528-9245). =========================================================================================================== The second line of data is where I will o the initial search, so I know how to code that. What I need some guidance on is how to go and get the line (last line in the example above) that has the phone number at the end of the line. Can someone point me in the right direction? Barry
  10. I am working on some code to modify the current date to a different format and have ran into a snag. The last array element I am trying to assign will not work and gives errors. All of the other assignments work and when I comment out #12, the code works. It has to be something very simple I am missing, but I just do not see it. Can someone take a look and help me out? Also, is there a way I can do these assignments without using so much space? Thanks ... ;===================================================== ; Script name: Date_Test ; Author: Barry Bowden ; Purpose: Test various date variables and arrays to get a specific ; date format from the current date. ; Created: 6 March 2011 ; Changes: n/a) ; Last rev. n/a ;===================================================== MsgBox(0,"Date","Today is ... " & @MDAY & " " & _Month() & " " & @YEAR & @CRLF & @CRLF & "Hour = " & @HOUR & @CRLF & "Minutes = " & @MIN & @CRLF & "Seconds = " & @SEC & @CRLF & @CRLF & @HOUR & ":" & @MIN & ":" & @SEC) Func _Month() Dim $Months[12] $Months[1] = "Jan" $Months[2] = "Feb" $Months[3] = "Mar" $Months[4] = "Apr" $Months[5] = "May" $Months[6] = "Jun" $Months[7] = "Jul" $Months[8] = "Aug" $Months[9] = "Sep" $Months[10] = "Oct" $Months[11] = "Nov" $Months[12] = "December" $MonthName = $Months[@MON] ;MsgBox(0,"Month Born","You were born in the month of " & $MonthName) Return $MonthName EndFunc
×
×
  • Create New...