par yvan KOENIG le 17/01/13, 16:29
À titre personnel, j’utilise le script ci-dedssous que j'ai doté (merci FastScripts) du raccourci cvmd + option + control + F
--[SCRIPT]
my activateGUIscripting()
tell application "Finder"
activate
set SystemFiles_loc to localized string "RV_SYSTEM_FILES_SLICE_NAME"
set Searching_loc to localized string "SB37"
end tell
if Searching_loc contains "^0…" then # ca, cs, da, el, English, fi, French, hr, Italian, no, pl, pt, pt_PT, ro, ru, sk, Spanish, sv, th, ukl
set Searching_loc to my supprime(Searching_loc, "^0…")
else if Searching_loc contains "'^0'…" then # Dutch
set Searching_loc to my supprime(Searching_loc, "'^0'…")
else if Searching_loc contains "“^0”…" then # zh_CN
set Searching_loc to my supprime(Searching_loc, "“^0”…")
else if Searching_loc contains "^0⋯" then # zh_TW
set Searching_loc to my supprime(Searching_loc, "^0⋯")
else if Searching_loc contains "^0" then
set Searching_loc to my supprime(Searching_loc, "^0")
if Searching_loc contains "…" then # German, hu, ko, tr
set Searching_loc to my supprime(Searching_loc, "…")
else if Searching_loc contains "..." then # Japanese
set Searching_loc to my supprime(Searching_loc, "...")
end if
else if Searching_loc contains "0^" then
set Searching_loc to my supprime(Searching_loc, "^0⋯")
if Searching_loc contains "…" then # he
set Searching_loc to my supprime(Searching_loc, "…")
else if Searching_loc contains "..." then # ar
set Searching_loc to my supprime(Searching_loc, "...")
end if
end if
tell application "System Events" to tell application process "Finder"
set mt to 7 # menu Fenêtres
tell menu bar 1 to tell menu bar item mt to tell menu 1 to set menuItems to name of menu items
set searchingAvailable to false
repeat with mi from 1 to count of menuItems
if item mi of menuItems contains Searching_loc then
set searchingAvailable to true
exit repeat
end if
end repeat
if searchingAvailable then
# bring the existing searching window to front
tell menu bar 1 to tell menu bar item mt to tell menu 1 to click menu item mi
else
keystroke "f" using {command down}
delay 0.1
end if
tell last group of first splitter group of window 1
# value of pop up buttons
--> {"Type", "Quelconque"}
set TypeButton to first pop up button
click TypeButton
# name of menu items of menu 1 of TypeButton
--> {"Type", "Date de dernière ouverture", "Date de dernière modification", "Date de création", "Nom", "Contenu", "Visibilité du fichier", "Fichiers système", "Date de l’ajout", missing value, "Autre…"}
click menu item SystemFiles_loc of menu 1 of TypeButton
set AttributesButton to last pop up button
click AttributesButton
name of menu items of menu 1 of AttributesButton
--> {"ne sont pas inclus", "sont inclus"}
click last menu item of menu 1 of AttributesButton
name of buttons
--> {"+", "-"}
click button 1
end tell
end tell
#=====
(*
removes every occurences of d in text t
*)
on supprime(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to ""
set t to l as text
set AppleScript's text item delimiters to oTIDs
return t
end supprime
#=====
on activateGUIscripting()
(* to be sure than GUI scripting will be active *)
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true
end tell
end activateGUIscripting
#=====
--[/SCRIPT]
Quand j’aurai le temps, je chercherai où est définie la chaîne « Fichiers système » pour récupérer son contenu quelle que soit la langue utilisée par le système.
Yvan KOENIG (VALLAURIS, France) jeudi 17 janvier 2013 15:29:48
edit #1: la chaîne « Fichiers système » est définie dans les resources du Finder.
Comme annoncé, le script utilise désormais la chaîne correspondant à la langue employée par le système.
edit #2: désormais, le script n’ouvre pas une nouvelle fenêtre de recherche s’il en existe déjà une.