S
Sam Elowitch
Is it possible to write an AppleScript that will select a folder and apply
an Entourage rule to its contents? I'm stuck....
-Sam
an Entourage rule to its contents? I'm stuck....
-Sam
Is it possible to write an AppleScript that will select a folder and apply
an Entourage rule to its contents? I'm stuck....
Paul,
Here¹s what I tried (it¹s very similar to what you proffered):
tell application "Microsoft Entourage"
set theFolder to folder "Personal" of folder "Inbox"
set allGroupMembers to (content of every group entry of group
"Subscribed Forums")
delete (every message of theFolder whose sender is in allGroupMembers
and read status is read)
end tell
For some reason, it doesn't seem to work.
Also, how come the second-to-last command does not read "and WHOSE read
status is read"?
Because it's not English, it's AppleScript. How come it doesn't say "AND
THEN go to sleep" or "THEN have a beer"? For the same reason.
I don't know why it's not working for you. It may be because a certain
item-to-list coercion isn't working. You can do the same thing by a slower
process:
tell application "Microsoft Entourage"
set theFolder to folder "Personal" of folder "Inbox"
set allGroupMembers to (content of every group entry of group
"Subscribed Forums")
set allMsgs to (every message of theFolder)
repeat with i from 1 to (count allMsgs)
set theMsg to item i of allMsgs
if {sender of theMsg} is in allGroupMembers and read status of
theMsg is read then
delete theMsg
end if
end repeat
end tell
The syntax is often deceptively difficult in part because its "English-like"
feel can beguile you into thinking it is easy, which it's not.
The funny thing about AppleScript, I find, is that while reading an existing
script makes one thing that AS is extremely logical and fair easy to follow,
this is not always the case when trying to build a script from scratch.
The syntax is often deceptively difficult in part because its "English-like"
feel can beguile you into thinking it is easy, which it's not.