• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Multi application support in single script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi application support in single script


  • Subject: Multi application support in single script
  • From: CasBaH Software <email@hidden>
  • Date: Sat, 28 Jun 2003 00:36:33 +0200

Hi there

I am trying to build an AppleScript (for Mac OS X) that supports
several clients providing the same service - but with mixed luck.
What I'm trying to do is to support different email applications in the
same script, but the applications referenced in the script might not be
installed on all computers running the script. For now I have
implemented the wanted functionality for Mail, Entourage, Eudora, and
Mailsmith. When I run my script and e.g. Eudora is not launched it will
be launched by my script. I have also gotten reports from users without
Entourage installed that the script asks for Entourage.
I thought I had solved this problem by checking that said application
is running at the time of running the script - see enclosed script
snippets.
Is it not possible to create this kind of AppleScript? Must I create a
separate script for each email client?

Script snippets to (perhaps) ease the understanding:

on run {}
set messageList to {}
if ProcessNamedIsRunning("Mail") then
set messageList to GetMailList(messageList)
end if
if (count of messageList) = 0 then
if ProcessNamedIsRunning("Microsoft Entourage") then
set messageList to GetEntourageList(messageList)
end if
end if
if (count of messageList) = 0 then
if ProcessNamedIsRunning("Eudora") then
set messageList to GetEudoraList(messageList)
end if
end if
if (count of messageList) = 0 then
if ProcessNamedIsRunning("Mailsmith") then
set messageList to GetEudoraList(messageList)
end if
end if
ProcessMessages(messageList, true)
end run

on ProcessNamedIsRunning(processName)
tell application "System Events"
return (exists application process processName)
end tell
end ProcessNamedIsRunning

on GetMailList(msgList)
tell application "Mail"
-- Do stuff
end tell
return msgList
end GetMailList


on GetEntourageList(msgList)
tell application "Microsoft Entourage"
-- Do stuff
end tell
return msgList
end GetEntourageList


on GetEudoraList(msgList)
tell application "Eudora"
-- Do stuff
end tell
return msgList
end GetEudoraList


on GetMailsmithList(msgList)
tell application "Mailsmith"
-- Do stuff
end tell
return msgList
end GetMailsmithList

Regards,
Christian Bxtker Hxj

CasBaH Software
www.casbahsoft.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Strange problem with text item delimiters
  • Next by Date: Newbie blues (was Remove spaces)
  • Previous by thread: long question about how to handle timeouts (AS techniques & HIG)
  • Next by thread: Newbie blues (was Remove spaces)
  • Index(es):
    • Date
    • Thread