use framework "Foundation"
use framework "AppKit"
use scripting additions
set theInfo to (current application's NSUserDefaults's alloc()'s init()'s persistentDomainForName:"com.apple.dock") as record
set theMatches to get theInfo's |persistent-apps|
tell current application to say (count of theMatches) -- returns '61'
set MatchingList to {}
set x to 0
repeat with thisRecord in theMatches
set x to x + 1
set theTestMatch to get thisRecord's |tile-data|
set theMMMatch to theTestMatch's |file-label|
if theMMMatch is "Mail Manager" then
say "found"
set end of MatchingList to item x of theMatches
end if
end repeat
MatchingList