I'm trying to get values from a log file of all the occurrence of a value Recorded on the following key :
> <key>MyTime</key> <string>2019-03-29T08:48:18+0000</string> > <key>serviceToken</key>
I can get the first occurrence of the value I want with the following code, but how can I search for more occurrence and add in secondary variable ?
##Getting the file name set ShortDate to short date string of (current date) set [dayN, MonthN, YearN] to the words of ShortDate set myUSDate to YearN & MonthN & dayN as string set myFileName to "TIME" & myUSDate & ".log" set p to "/Users/kevin/Library/Logs/MyAPP/" & myFileName set plistfile_path to POSIX file p property leftEdge1 : "<key>myValueTime</key>" property rightEdge1 : "<key>serviceToken</key>" set myNewCaseNote to "" set newFile to (plistfile_path as text) set theSource to read file newFile as text set theText to Unicode text try set saveTID to text item delimiters set text item delimiters to leftEdge1 set classValue to text item 2 of theSource set text item delimiters to rightEdge1 set myCaseNote to text item 1 of classValue set text item delimiters to saveTID myCaseNote end try
But how can I get other occurrence of this time/data ? And not only the first one