I am pulling text from mail.app. The emails I am parsing have within them a list of dates (amongst other things):
Now I’m trying to get the dates into a list. No problem I thought…
Using the following methods did NOT work:
Using paragraphs did NOT work, returned the entire thing as a paragraph
set AppleScript’s text item delimiters to (ASCII character 13) – (Carriage Return)
set AppleScript’s text item delimiters to (ASCII character 10) – (LF)
set rundates to "5/27/2012¨ 5/28/2012¨ 5/29/2012¨ 5/30/2012¨ 5/31/2012¨ 6/1/2012¨ 6/3/2012¨ 6/4/2012¨ 6/5/2012¨ 6/6/2012¨ 6/7/2012¨ 6/8/2012¨ 6/10/2012¨ 6/11/2012"
set mylist to {}
repeat with z from 1 to count of characters of rundates
if character z of rundates is not (ASCII character 202) then
copy (ASCII number (character z of rundates)) to end of mylist
----set mylist to mylist & character z of rundates
end if
end repeat
--return mylist ---{53, 47, 50, 55, 47, 50, 48, 49, 50, 13, 53, 47, 50, 56, 47, 50, 48, 49, 50, 13, 53, 47, 50, 57, 47, 50, 48, 49, 50, 13, 53, 47, 51, 48, 47, 50, 48, 49, 50, 13, 53, 47, 51, 49, 47, 50, 48, 49, 50, 13, 54, 47, 49, 47, 50, 48, 49, 50, 13, 54, 47, 51, 47, 50, 48, 49, 50, 13, 54, 47, 52, 47, 50, 48, 49, 50, 13, 54, 47, 53, 47, 50, 48, 49, 50, 13, 54, 47, 54, 47, 50, 48, 49, 50, 13, 54, 47, 55, 47, 50, 48, 49, 50, 13, 54, 47, 56, 47, 50, 48, 49, 50, 13, 54, 47, 49, 48, 47, 50, 48, 49, 50, 13, 54, 47, 49, 49, 47, 50, 48, 49, 50}
---===== Notice the 13s? So this should work right? ====---
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to (ASCII character 13) -- (Carriage Return)
set runList to text items of rundates
set AppleScript's text item delimiters to tid
return runList --{"5/27/2012¨ 5/28/2012¨ 5/29/2012¨ 5/30/2012¨ 5/31/2012¨ 6/1/2012¨ 6/3/2012¨ 6/4/2012¨ 6/5/2012¨ 6/6/2012¨ 6/7/2012¨ 6/8/2012¨ 6/10/2012¨ 6/11/2012"}
Anyone have any ideas? What am I doing wrong here…