I saved the datas from message #6 in a text file named “appointments.txt” on my desktop.
Then I ran :
set p2d to path to desktop as string
set myFile to (p2d & "appointments.txt") as «class furl»
set myDatas to read myFile as «class utf8»
set myKey to quote & "calActive" & quote
set enListe to my decoupe(myDatas, myKey)
set lesBons to {}
repeat with i from 2 to count enListe
set end of lesBons to (paragraph -1 of item (i - 1) of enListe) & myKey & paragraph 1 of item i of enListe
end repeat
log lesBons
set enTexte to my recolle(lesBons, linefeed)
#=====
on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
#=====
on recolle(l, d)
local oTIDs, t
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set t to l as text
set AppleScript's text item delimiters to oTIDs
return t
end recolle
#=====
(*
replaces every occurences of d1 by d2 in the text t
*)
on remplace(t, d1, d2)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d1}
set l to text items of t
set AppleScript's text item delimiters to d2
set t to l as text
set AppleScript's text item delimiters to oTIDs
return t
end remplace
#=====
I got a list which is not easy to read:
(*<td id="20201204" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('04-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Friday, December 4, 2020" href="#4">4</a></td>, <td id="20201207" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('07-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Monday, December 7, 2020" href="#7">7</a></td>, <td id="20201214" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('14-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Monday, December 14, 2020" href="#14">14</a></td>, <td id="20201218" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('18-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Friday, December 18, 2020" href="#18">18</a></td>, <td id="20201221" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('21-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Monday, December 21, 2020" href="#21">21</a></td>, <td id="20201226" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('26-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Saturday, December 26, 2020" href="#26">26</a></td>, <td id="20201228" class="calActive" align="center" onclick="IWRSeatAvail.showAppointmentDate('28-Dec-2020', '9:00 AM - 6:00 PM|')" style="width:14%;"><a class="calActiveLink" title="Monday, December 28, 2020" href="#28">28</a></td>*)
and I got a text object which may be helpful:
"<td id=\"20201204\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('04-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Friday, December 4, 2020\" href=\"#4\">4</a></td>
<td id=\"20201207\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('07-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 7, 2020\" href=\"#7\">7</a></td>
<td id=\"20201214\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('14-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 14, 2020\" href=\"#14\">14</a></td>
<td id=\"20201218\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('18-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Friday, December 18, 2020\" href=\"#18\">18</a></td>
<td id=\"20201221\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('21-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 21, 2020\" href=\"#21\">21</a></td>
<td id=\"20201226\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('26-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Saturday, December 26, 2020\" href=\"#26\">26</a></td>
<td id=\"20201228\" class=\"calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('28-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 28, 2020\" href=\"#28\">28</a></td>"
I guess that some extraneous cleaning may be applied but I don’t know what may be dropped and what must be preserved.
For instance if I add two instructions to get:
log lesBons
set enTexte to my recolle(lesBons, linefeed)
set enTexte to my remplace(enTexte, "<td id=" & quote, "")
set enTexte to my remplace(enTexte, quote & " class=" & quote, tab)
the returned text become:
"20201204 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('04-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Friday, December 4, 2020\" href=\"#4\">4</a></td>
20201207 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('07-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 7, 2020\" href=\"#7\">7</a></td>
20201214 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('14-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 14, 2020\" href=\"#14\">14</a></td>
20201218 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('18-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Friday, December 18, 2020\" href=\"#18\">18</a></td>
20201221 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('21-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 21, 2020\" href=\"#21\">21</a></td>
20201226 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('26-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Saturday, December 26, 2020\" href=\"#26\">26</a></td>
20201228 calActive\" align=\"center\" onclick=\"IWRSeatAvail.showAppointmentDate('28-Dec-2020', '9:00 AM - 6:00 PM|')\" style=\"width:14%;\"><a class=\"calActiveLink\" title=\"Monday, December 28, 2020\" href=\"#28\">28</a></td>"
which become easy to filter because the “compact” dates are perfectly visible.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 9 mai 2020 23:13:02