Il codice seguente genera un collegamento per scaricare il file HD da un sito ogni giorno, ma non sa come determinare se il link è valido o meno. Come posso verificare la validità del link?
set z to ""
set d to tid(tid(short date string of (current date), "/"), "")
set w to weekday of (current date)
set r to 10
if d > 20000000 then
set Prefix to d as text
else
set Prefix to (d + 20000000) as text
end if
on tid(input, delim)
set {oldTID, my text item delimiters} to {my text item delimiters, delim}
if class of input is list then
set output to input as text
else
set output to text items of input
end if
set my text item delimiters to oldTID
return output
end tid
set x to 1
set y to ((characters 1 thru 4 of Prefix) as string)
repeat with i from 1 to r
if i < 10 then
set x to "0" & i
else
set x to i
end if
set c to "http://streaming.hkjc.edgesuite.net/hdflash/racingfocus/" & y & "/" & Prefix & "/" & x & "/" & "chi/racingfocus_" & Prefix & "_" & x & "" & "_chi_2500kbps.mp4"
set z to z & c & "" & return & return
set i to i + 1
end repeat
display dialog z