Read the rest of the hint for the code that processes the com.apple.recentitems.plist file:
on run
set olddelims to my text item delimiters
set NUM_APPS to 5
set NUM_DOCS to 3
--first process recent applications...
set recentapps_string to process_recentitems("app", NUM_APPS)
-- now process recent docs...
set recentdocs_string to process_recentitems("doc", NUM_DOCS)
set my text item delimiters to olddelims
return "recent apps: " & recentapps_string & return ¬
& "recent docs: " & recentdocs_string
end run
on process_recentitems(itemtype, num_items)
--first process recent items...
set recentitems to (do shell script ¬
"defaults read com.apple.recentitems " & ¬
itemtype & "s | grep -v '(' | grep -v ')'")
set my text item delimiters to ","
set recentitems to (text items 1 through num_items of recentitems)
-- remove any double-quotes
set my text item delimiters to "\""
set recentitems_noquotes to {}
repeat with the_item in recentitems
set recentitems_noquotes to recentitems_noquotes & ¬
(text item 2 of the_item)
end repeat
-- now get just the itemname
set my text item delimiters to "/"
set recentitems_names to {}
repeat with the_item in recentitems_noquotes
set recentitems_names to recentitems_names & ¬
(text item -1 of the_item)
end repeat
if (itemtype is "app") then
-- now strip off the '.app' extension, if it exists
set my text item delimiters to ".app"
set recentitems_shortnames to {}
repeat with the_item in recentitems_names
set recentitems_shortnames to ¬
recentitems_shortnames & (text item 1 of the_item)
end repeat
-- now make a nice formatted recent items string...
set my text item delimiters to "; "
set recentitems_string to (recentitems_shortnames as string)
else
-- just make your nice string
set my text item delimiters to "; "
set recentitems_string to (recentitems_names as string)
end if
return recentitems_string
end process_recentitems
Anyway, I thought some people might find this useful.

