Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > fr.comp.sys.mac.programmation > #2952

Re: MacCafé + Fermeture fenêtres: Correction

From "M.V." <mv@gmail.com.invalid>
Newsgroups fr.comp.sys.mac.programmation
Subject Re: MacCafé + Fermeture fenêtres: Correction
Date 2026-02-18 16:34 +0000
Organization M.V. & Co
Message-ID <10n4plr$56o$1@rasp.pasdenom.info> (permalink)
References <10mpf1c$31v81$1@dont-email.me> <10n4epb$gs4$1@rasp.pasdenom.info>

Show all headers | View raw


Dans le message <10n4epb$gs4$1@rasp.pasdenom.info>, j'ai écrit le mercredi 18 février 2026 à 14 h 28 :

>       tell UI element 16 of menu "Fenêtre" of menu bar item "Fenêtre" of menu bar 1 to click

Ça c'est pas terrible car demander x fois "Tout ramener au premier plan" 
est problématique surtout quand une 30aine de fenêtres sont ouvertes.

Donc je limite l'appel à cet item à une seule fois grâce à la variable k :
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
tell application "MacCafé" to activate
set k to 0
tell application "System Events" to tell application process "MacCafé"
repeat with win_item in windows
try
if name of UI element 16 of menu "Fenêtre" of menu bar item "Fenêtre" of menu bar 1 is "Tout ramener au premier plan" then
if k = 0 then
-- pour ramener les fenêtres devant la fenêtre Base uniquement si k = 0 :
tell UI element 16 of menu "Fenêtre" of menu bar item "Fenêtre" of menu bar 1 to click
set k to 1 -- pour empêcher un futur nouvel appel à l'item "Tout ramener au premier plan"
end if
end if
on error -- la fenêtre est soit celle des préfs soit la fenêtre "À props de MacCafé"
click UI element 1 of window 1
end try
delay 0.2
keystroke "w" using command down -- ne fermera pas la fenêtre Base
end repeat
end tell

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

Bof bof…

-- 
🇺🇦 Michel Vauquois - <http://michelvauquois.fr> 🇺🇦

Back to fr.comp.sys.mac.programmation | Previous | NextPrevious in thread | Find similar


Thread

Re: MacCafé + Fermeture fenêtres: Correction "M.V." <mv@gmail.com.invalid> - 2026-02-18 13:28 +0000
  Re: MacCafé + Fermeture fenêtres: Correction Joseph B <joseph@nowhere.invalid> - 2026-02-18 13:57 +0000
  Re: MacCafé + Fermeture fenêtres: Correction "M.V." <mv@gmail.com.invalid> - 2026-02-18 16:34 +0000

csiph-web