On 10 Apr 2014, at 8:14 am, koenig.yvan <
email@hidden> wrote:
Maybe somebody will have posted a fine code before I wake up.
Alas, you're probably wide awake by now. Here's an ASObjC-based handler to get just the names:
use framework "Foundation"
on returnRecentAppNames()
set thePath to current application's NSString's stringWithString:"~/Library/Preferences/com.apple.recentitems.plist"
set theDict to current application's NSDictionary's dictionaryWithContentsOfFile:(thePath's stringByExpandingTildeInPath())
return (theDict's valueForKeyPath:"RecentApplications.CustomListItems.Name") as list
end returnRecentAppNames
And if you want the paths:
use framework "Foundation"
on returnRecentAppPaths()
set thePath to current application's NSString's stringWithString:"~/Library/Preferences/com.apple.recentitems.plist"
set theDict to current application's NSDictionary's dictionaryWithContentsOfFile:(thePath's stringByExpandingTildeInPath())
set theBookmarkData to (theDict's valueForKeyPath:"RecentApplications.CustomListItems.Bookmark") as list
set thePaths to {}
repeat with aData in theBookmarkData
set theInfo to (current application's NSURL's resourceValuesForKeys:{current application's NSURLPathKey} fromBookmarkData:aData)
set end of thePaths to (theInfo's valueForKey:(current application's NSURLPathKey)) as text
end repeat
return thePaths
end returnRecentAppPaths