Wow!!!
That was slick! Thanks a lot.
Removed the dialog thing, cause I’m showing it on my desktop
Two questions.
1.I get an error message when I add “24” as a show. It says target_dates not set" or something. And it returns the last target_dates under “else”.
2. Can I make the upcomming episode bold?
with your UNIX filter the first displayed episode of “24” is in the future,
so add one line to avoid this error
...
set year of d to (item 6 of w as integer) + 2000
set target_dates to show & return -- <-- add this line
if d < cd then
...
With AppleScript’s display capabilities: no
Thanks again Stefan.
That new line did the trick.
Hmmm, no bold then. What about adding a star “*” before the entry?
The added line was at the wrong place.
Here the whole script again, the upcoming episode has a star at the beginnig
property theMonths : "JanFebMarAprMayJunJulAugSepOctNovDec"
set ShowList to {"PrisonBreak", "Lost", "24"}
set showDates to ""
repeat with i in ShowList
set showDates to showDates & get_show_data(i)
end repeat
-- display dialog showDates
on get_show_data(show)
set p_list to paragraphs of (do shell script "curl -s [url=http://epguides.com/]http://epguides.com/"[/url] & show & "/ | grep '^ *[0-9]' | sed -e 's/<[^>]*>//g' | tail -8 | cut -c1-13,28-")
tell (current date) to set cd to it - (its time)
set target_dates to show & return
repeat with this_p in p_list
set w to words of this_p
set item 5 of w to ((offset of (item 5 of w) in theMonths) div 3 + 1)
copy cd to d
set day of d to item 4 of w as integer
set month of d to item 5 of w
set year of d to (item 6 of w as integer) + 2000
if d < cd then
set target_dates to show & return & " " & contents of this_p & return
else
set target_dates to target_dates & "*" & contents of this_p & return & return
exit repeat
end if
end repeat
return target_dates
end get_show_data
thanks again Stefan.
I changed the “tail -8” to 12. So that I could view all the episodes from 24.
Thanks for all your help.
Is it possible to sort the output on release dates as well?
So that it’s output looks like this: