tell application "Safari"
activate
open location "https://www.imaccanici.org/forum/search.php?search_id=unreadposts"
delay 2
set pagina to document of front window
set sorgente_1 to source of pagina
set sorgente to quoted form of sorgente_1
set grep4 to "=[0-9][0-9][0-9][0-9]&v"
set grep5 to "=[0-9][0-9][0-9][0-9][0-9]&v"
try
set ID4 to do shell script "echo " & sorgente & " | grep -o " & quoted form of grep4
set numeroID to count of paragraph of ID4
repeat with n from 1 to numeroID
set IDtab to characters 2 thru 5 of paragraph n of ID4 as text
set URLtab to "https://www.imaccanici.org/forum/viewtopic.php?f=9&t=" & IDtab & "&view=unread#unread"
open location URLtab
delay 0.2
end repeat
end try
try
set ID5 to do shell script "echo " & sorgente & " | grep -o " & quoted form of grep5
set numeroID to count of paragraph of ID5
repeat with n from 1 to numeroID
set IDtab to characters 2 thru 6 of paragraph n of ID5 as text
set URLtab to "https://www.imaccanici.org/forum/viewtopic.php?f=9&t=" & IDtab & "&view=unread#unread"
open location URLtab
delay 0.2
end repeat
end try
end tell
tell application "Safari"
activate
open location "https://www.imaccanici.org/forum/search.php?search_id=unreadposts"
delay 2
set pagina to document of front window
set sorgente_1 to source of pagina
set sorgente to quoted form of sorgente_1
set greppalo to "=[0-9][0-9][0-9][0-9][0-9]&v"
try
set ID5 to do shell script "echo " & sorgente & " | grep -o " & quoted form of greppalo
set numeroID to count of paragraph of ID5
repeat with n from 1 to numeroID by 2
set IDtab to characters 2 thru 6 of paragraph n of ID5 as text
set URLtab to "https://www.imaccanici.org/forum/viewtopic.php?f=9&t=" & IDtab & "&view=unread#unread"
open location URLtab
delay 1
end repeat
end try
end tell
Piuttosto rustico, a volte qualche pagina non risulta letta dopo averla letta ma in generale funziona. Sempre da salvare nella cartella ~/Library/Scripts/ per averlo nel menù Script nella barra dei menù.
Colgo l'occasione nel riaprire questo topic per ringraziare l'ideatore di questo meraviglioso script per Safari, senza il quale non avrei mai risparmiato tutto questo tempo ogni giorno, negli anni.
Difatti io lo uso ancora di continuo. A volte alcune discussioni non risultano poi lette e va fatta una passata a mano. Ho provato anche a modificare i ritardi ma niente. Mah.
Per Safari TP immagino che la sintassi sia la stessa ma ora sono su iPad e non posso provare.