Accessing groups within Applescript

J

james.g

Version: 2008
Operating System: Mac OS X 10.6 (Snow Leopard)
Processor: Intel

So, I am trying to adapt an older script designed for Entourage 2004 into playing nice with Entourage 2008, namely the infamous "Send Complex HTML X" script by Paul Berkowitz's.

The issue that the script dies with the error message "Can't get group whose name = " followed by the name of the group put as a recipient in the blank email. I have attempted to work around this line by using Rob Buckley's attempt at fixing it with the following:

try
set theAddressBooks to the address books
repeat with theAddressBook in theAddressBooks
try
tell theAddressBook to set thegroup to (first group where its name is grpName)
exit repeat
end try
end repeat
on error errMsg
beep
error errMsg
return
end try

Sadly this doesn't work neither, with a strange symptom that if I try to push the value of groupname into a dialog, it never shows.

So far, I am at a loss as to what is going wrong, or how to get at the group object and grab the name. Any suggestions?
 
D

Diane Ross

So, I am trying to adapt an older script designed for Entourage 2004 into
playing nice with Entourage 2008, namely the infamous "Send Complex HTML X"
script by Paul Berkowitz's.

If you get this working, please post the results here. You can send me the
script off list and I'll upload on the Entourage Help Page downloads page.

The AppleScript-Users mailing list might be able to help:

([email protected])

<http://lists.apple.com/mailman/listinfo/applescript-users>
 
J

james.g

Diane,
Whilst I'm glad to see a somewhat quick response, I am here because I am unable to find a working solution and feel that all immediate methods have been exhausted and I am looking to see if someone else has a work around. As this is an Entourage specific problem, I will, for now at least, hold back from discussing it on the mailing list.
 
D

Diane Ross

Whilst I'm glad to see a somewhat quick response, I am here because I am
unable to find a working solution and feel that all immediate methods have
been exhausted and I am looking to see if someone else has a work around. As
this is an Entourage specific problem, I will, for now at least, hold back
from discussing it on the mailing list.

There are a lot of Entourage users on that list that could probably help
with the script. We don't have a lot of scripter's now that monitor this
list.
 
W

William Smith [MVP]

So far, I am at a loss as to what is going wrong, or how to get at
the group object and grab the name. Any suggestions?

Can you post a snippet of the code that's not working? I'm not familiar
with Paul's script nor any workarounds by anyone else. Would be easier
to simply have you post the script snippet that's not working and let
others work on that.

I'm not sure this is what you're after, but the following code snippet
returns the name of the first group in each address book:

tell application "Microsoft Entourage"
set theAddressBooks to the address books
repeat with theAddressBook in theAddressBooks
name of first group of theAddressBook
exit repeat
end repeat
end tell

One suggestion, if you haven't tried already, would be to remove the
"try" statements so that the script will fail when you run it and show
you where the problem occurs.

Hope this helps!

--

bill

Entourage Help Page <http://entourage.mvps.org/>
Entourage Help Blog <http://blog.entourage.mvps.org/>
YouTalk <http://nine.pairlist.net/mailman/listinfo/youtalk>
Twitter: follow <http://twitter.com/meck>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top