Sujet : Re: Fermeture MacCafé
De : benoit (at) *nospam* leraillez.com.invalid ("Benoît L.")
Groupes : fr.comp.sys.mac.communicationDate : 06. Nov 2025, 15:02:29
Autres entêtes
Organisation : C'est celui qui dit qui est
Message-ID : <10ei9pl$e4u$1@rasp.pasdenom.info>
References : 1 2 3 4 5 6
User-Agent : MacCafe/3.04.1(4D18) ("kontir wild forest") (macOS 26.1.0 (25B78) - Mac16,8)
Le samedi 18 octobre 2025 à 08:37, Gilbert OLIVIER d'un élan de joie
s'exprima ainsi :
Si cela est possible, on pourrait même intégrer (avec ton accord bien
sûr) cet applet à MacCafé qui se chargerait de sa gestion (lancement
arrêt) en synchro avec lui même.
Voici un bout de script.app qui quitte MacCafé de façon drastique :
tell application "System Events"
set theID to (unix id of processes whose name is "MacCafé")
try
-- Should stop the application with no dialogs and no items saved.
do shell script "kill -9 " & theID
end try
end tell
Si je rajoute :
on quit
-- le script
end quit
Alors quand je lance le script il kill MacCafé et quitte. Question :
comment le lancer au shutdown ou le faire tourner indéfiniment en
attendant que le système lui demande de quitter ?
P.S.1 Si le script est dans MacCafé.app et que MacCafé l’exécute quand
on lui demande de quitter alors c’est violent mais si MacCafé ne le
lance qu’après avoir terminé ses lectures/écritures internes alors, d’un
certain point de vue, MacCafé kill 4D.
P.S.2 Si le script est dans MacCafé.app alors il doit connaître le nom
de l’application MacCafé (genre MacCafé béta3.app) et utiliser ce nom
dans la variable theID
tell application "Finder"
set AppleScript's text item delimiters to ":"
set myPathText to container of (path to me) as text
set myPathList to text items of myPathText as list
set listSize to count items of myPathList
set benoit to listSize - 1
set theID to item benoit of myPathList as text
set AppleScript's text item delimiters to ""
tell application "System Events"
set theID to (unix id of processes whose name is "MacCafé")
try
do shell script "kill -9 " & theID
end try
end tell
end tell
-- La prétention est à la connerie, ce que la mousse est à la bière.-+-Albert Simonin-+-