Double Tell and Outlook...possible?
Double Tell and Outlook...possible?
- Subject: Double Tell and Outlook...possible?
- From: Guy Parker <email@hidden>
- Date: Thu, 30 Aug 2001 09:32:10 +0100
I'm trying to write a Script that will control either Outlook Express or
Entourage (with common code) depending upon what's installed on the machine
running the Script. Since the two application's dictionaries are identical
(at least for the functions I need to use) I figure this should be possible
without writing two different versions.
I've tried the "double tell" technique but Outlook seems to be one of those
applications where this option won't work (maybe it has a "dynamic"
library?).
I wondered if the new "using terms from" capability would help but have had
no success...anyone know a good source of examples/documentation for this?
In the Script below the line "set MessageWindow to front window" generates
an event of "get window 1 of application "Outlook Express"" that produces an
error. But without the double tell the event is just "get window 1" which
works.
Can anyone think of clever changes that could make this work or an entirely
different approach to the same goal?
Thanks, Guy
tell application "Finder"
try
--Outlook Express as first choice
set MailClientPath to application file id "MSNM" as string
set MailClient to name of application file id "MSNM"
on error number -1728
try
--Entourage as second choice
set MailClientPath to application file id "OPIM" as string
set MailClient to name of application file id "OPIM"
on error number -1728
beep
display dialog "Couldn't locate Outlook Express or Entourage."
error number -128
end try
end try
end tell
launch application MailClientPath
tell application "Outlook Express" --Allows to compile
tell application MailClient
set MessageWindow to front window
--other stuff follows...
end tell
end tell