Hi
I’m building an application a part of which allows users to email information but I do not have access to our company’s Exchange Server. Is there a way in Entourage to get the company wide listings? I can get my contacts but that’s not the same. If you go into Entourage and click on the contacts icon there’s a subgroup under that called Directory Services, which contains a company wide listing broken down by department. I’m assuming that this listing gets populated when Entourage talks to the Exchange server, is there a way to tap into this listing with AppleScript?
I modified a script I found on Microsoft’s site and it works (it’s a little slow but it does the trick). I’m filtering for capital letters as that is how our email system is set up, anything lower case is an account I don’t need for my purposes. I’d love to see if there’s a more efficient way to do this than what I am doing.
set resultslist to {}
set searchlist to {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
tell application "Microsoft Entourage"
set ExchangeAccountList to every Exchange account as list
repeat with letter in searchlist
set theReturnedList to every item of (do OWA GAL search using account Exchange account 1 search string letter)
if (count of theReturnedList) > 1 then
repeat with i from 1 to count of theReturnedList
set displayName to display name of item i of theReturnedList
set domainAlias to domain alias of item i of theReturnedList
-->filter for non name items
if (ASCII number (character 1 of domainAlias)) > 64 and (ASCII number (character 1 of domainAlias)) < 91 then
copy domainAlias to end of resultslist
end if
end repeat
else
set displayName to display name of item 1 of theReturnedList
set domainAlias to domain alias of item 1 of theReturnedList
-->filter for non name items
if (ASCII number (character 1 of domainAlias)) > 64 and (ASCII number (character 1 of domainAlias)) < 91 then
copy domainAlias to end of resultslist
end if
end if
end repeat
end tell
return resultslist