Scripting rules

B

Brett Zamir

Is there any way to enable and disable rules via Applescript?

Thanks,
Brett
 
M

matt neuburg

Brett Zamir said:
Is there any way to enable and disable rules via Applescript?

AFAICT you can't access rules at all. Paul will be along in a second to
tell us more... However, I've managed quite a bit of voodoo using GUI
scripting, so you might give that a shot. m.
 
P

Paul Berkowitz

AFAICT you can't access rules at all. Paul will be along in a second to
tell us more... However, I've managed quite a bit of voodoo using GUI
scripting, so you might give that a shot. m.

Well, I'm here, but there's nothing to add. That's about it. OK, one thing
to add: virtually all rules amount to a one-line script. So if you can
script, you should consider just running a script from a rule. The script
could specify other criteria than the ones that rules offer, if that's what
you're trying to do.

If all you want is a keyboard shortcut to turn rules off and on at whim
rather than according to specified criteria, then GYU scripting - using menu
items , never buttons, since buttons won't work (well, hardly ever) in
Entourage.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
B

Brett Zamir

Basically, I'm already running a rule to open a script. The script
increases the system volume all the way and beeps and says that I have mail
so that I can hear that fact in another room. (I don't want to waste money
or space by sending it to my cell phone; I was surprised to find that there
apparently aren't any mac phone ringers besides for home automation that I
could find).

The thing is, although I'd like to keep getting mail throughout the night in
case I'm working on something, I don't want my family woken up by the
effects of this rule that beeps automatically and loudly (and I don't want
to have to remember to disable the rule each night). So I thought I could
run an Applescript on a timer program (or as an Entourage schedule) which
would enable or disable the rule.

Will the script that one enables on a rule operate on the message that it is
working on (to find the received time for example--since I cannot just add a
criterion to search internet headers since the received time does not appear
in a header)?

As far as GUI scripting, I could only get it to open the Rules; I couldn't
select one to enable or disable (which apparently necessitates clicking one
of the radio buttons).

Thanks in advance,
Brett
 
B

Brett Zamir

Basically, I'm already running a rule to open a script. The script
increases the system volume all the way and beeps and says that I have mail
so that I can hear that fact in another room. (I don't want to waste money
or space by sending it to my cell phone; I was surprised to find that there
apparently aren't any mac phone ringers besides for home automation that I
could find).

The thing is, although I'd like to keep getting mail throughout the night in
case I'm working on something, I don't want my family woken up by the
effects of this rule that beeps automatically and loudly (and I don't want
to have to remember to disable the rule each night). So I thought I could
run an Applescript on a timer program (or as an Entourage schedule) which
would enable or disable the rule.

Will the script that one enables on a rule operate on the message that it is
working on (to find the received time for example--since I cannot just add a
criterion to search internet headers since the received time does not appear
in a header)?

As far as GUI scripting, I could only get it to open the Rules; I couldn't
select one to enable or disable (which apparently necessitates clicking one
of the radio buttons).

Thanks in advance,
Brett
 
P

Paul Berkowitz

As far as GUI scripting, I could only get it to open the Rules; I couldn't
select one to enable or disable (which apparently necessitates clicking one
of the radio buttons).

Right. None of the MS controls - buttons, checkboxes, etc. - in windows seem
to be accessible to GUI scripting. Only menu items, and the close box
buttons.

Since you actually do have criteria you can specify (e.g. between 11 Pm or
12 AM and 8 AM) why don't you just include those criteria in the script that
alters the system volume? Or if that doesn't work, run a script from
schedules that turn the volume up and down at specific times? That would be
easiest. (You can even enable and disable a schedule by script, though I
don't think that's needed here. Just have two schedules; one that runs a
script at 11 pm that turns the volume down, and another at 8 AM that turns
it up.)

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
Top