j'ai un script de lecteur de news qui produit de temps en temps des
erreurs "AppleEvent timed out"
après, le script coince car attend une réponse (clik OK) de
l'utilisateur.
le script :
on idle
with timeout of 120 seconds
set ok to do shell script "/Users/yvon/bin/checkNntp"
if ok = "true" then tell application "MacSOUP"
connect with fetching news
connect with fetching tagged headers
connect with sending
end tell
end timeout
return 300
end idle
donc vraisemblement c'est le "with timeout of 120 seconds" qui pose pb,
le serveur de news free atént qqfois très lent...
comment donc inserrer un "on error s number n" qui évite l'ouverture
d'une fenêtre d'erreur ?
mon script ruby "/Users/yvon/bin/checkNntp" check si le serveur est
"reachable"
--
une bévue
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
pere.noel
Une bévue wrote:
le script : on idle with timeout of 120 seconds set ok to do shell script "/Users/yvon/bin/checkNntp" if ok = "true" then tell application "MacSOUP" connect with fetching news connect with fetching tagged headers connect with sending end tell end timeout return 300 end idle
je l'ai changé en :
on idle with timeout of 5 * 60 seconds set ok to do shell script "/Users/yvon/bin/checkNntp" if ok = "true" then try tell application "MacSOUP" activate with timeout of 4 * 60 seconds purge connect with fetching news, fetching tagged headers and sending end timeout end tell end try end timeout return 10 * 60 end idle
d'après le manuel MacSOUP ;-)
-- une bévue
Une bévue <pere.noel@laponie.com> wrote:
le script :
on idle
with timeout of 120 seconds
set ok to do shell script "/Users/yvon/bin/checkNntp"
if ok = "true" then tell application "MacSOUP"
connect with fetching news
connect with fetching tagged headers
connect with sending
end tell
end timeout
return 300
end idle
je l'ai changé en :
on idle
with timeout of 5 * 60 seconds
set ok to do shell script "/Users/yvon/bin/checkNntp"
if ok = "true" then try
tell application "MacSOUP"
activate
with timeout of 4 * 60 seconds
purge
connect with fetching news,
fetching tagged headers and sending
end timeout
end tell
end try
end timeout
return 10 * 60
end idle
le script : on idle with timeout of 120 seconds set ok to do shell script "/Users/yvon/bin/checkNntp" if ok = "true" then tell application "MacSOUP" connect with fetching news connect with fetching tagged headers connect with sending end tell end timeout return 300 end idle
je l'ai changé en :
on idle with timeout of 5 * 60 seconds set ok to do shell script "/Users/yvon/bin/checkNntp" if ok = "true" then try tell application "MacSOUP" activate with timeout of 4 * 60 seconds purge connect with fetching news, fetching tagged headers and sending end timeout end tell end try end timeout return 10 * 60 end idle
d'après le manuel MacSOUP ;-)
-- une bévue
pere.noel
Lionel Mychkine wrote:
Mais pourquoi donc passer par un shell script pour vérifier la dispo- nibilité du serveur ?
parce que je connais très mal AS...
je teste en ce moment, ta solution est effectivement la plus simple ! -- une bévue
Lionel Mychkine <mychkine@nowhere.invalid> wrote:
Mais pourquoi donc passer par un shell script pour vérifier la dispo-
nibilité du serveur ?
parce que je connais très mal AS...
je teste en ce moment, ta solution est effectivement la plus simple !
--
une bévue