As always your answer it's perfect.
use theLib : script "RecentItems Lib"
theLib's returnRecentAppPaths()
(*
{"/Applications/TextEdit.app",
"/Applications/Applications_MAS/ClamXav.app",
"/Applications/Applications perso/ouverture au démarrage/keep_clean_prefs.app",
"/Applications/Safari.app",
"/Applications/Applications perso/HexEdit Release/HexEdit.app",
"/Applications/Mail.app",
"/Applications/Utilities/AppleScript Editor.app",
"/Applications/System Preferences.app",
"/Applications/Preview.app",
"/Volumes/Adobe Flash Player Installer/Install Adobe Flash Player.app"}
Now, I must try to find where is stored the up-to-date list of recent items.
set theList to my nameOfSubMenuItems("Finder", 1, 9)
set trueList to {}
repeat with aString in theList
set aString to contents of aString
if aString is missing value then exit repeat
if (aString is not "Applications") and aString ends with ".app" then
set end of trueList to aString
end if
end repeat
trueList
--> {"Calculette.app", "ClamXav.app", "HexEdit.app", "keep_clean_prefs.app", "Moniteur d’activité.app", "Pages.app", "Pages.app", "Récupère le chemin.app", "Safari.app", "TextEdit.app"}
#=====
on nameOfSubMenuItems(theApp, mt, mi)
activate application theApp
tell application "System Events" to tell (first process whose frontmost is true) to tell menu bar 1 to ¬
tell menu bar item mt to tell menu 1 to tell menu item mi to tell menu 1 to return name of menu items
end nameOfSubMenuItems
#=====
I tried to force Finder to quit but it didn't updated the file.
Time to start a new safari.