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

Thanks,
Brett

Re: Scripting rules by matt

matt
Tue Aug 03 22:25:08 CDT 2004

Brett Zamir <b.zamir@comcast.net> wrote:

> 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.

--
matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
AppleScript: The Definitive Guide
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Read TidBITS! It's free and smart. http://www.tidbits.com

Re: Scripting rules by Paul

Paul
Wed Aug 04 00:37:17 CDT 2004

On 8/3/04 8:25 PM, in article 1ghylvi.nwwqa1rwa43kN%matt@tidbits.com, "matt
neuburg" <matt@tidbits.com> wrote:

> Brett Zamir <b.zamir@comcast.net> wrote:
>
>> 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.

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.


Re: Scripting rules by Brett

Brett
Wed Aug 04 00:54:58 CDT 2004

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


On 8/4/04 12:37 AM, in article BD35C41D.6E649%berkowit@spoof_silcom.com,
"Paul Berkowitz" <berkowit@spoof_silcom.com> wrote:

> On 8/3/04 8:25 PM, in article 1ghylvi.nwwqa1rwa43kN%matt@tidbits.com, "matt
> neuburg" <matt@tidbits.com> wrote:
>
>> Brett Zamir <b.zamir@comcast.net> wrote:
>>
>>> 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.
>
> 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.


Re: Scripting rules by Brett

Brett
Wed Aug 04 00:55:45 CDT 2004

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


On 8/4/04 12:37 AM, in article BD35C41D.6E649%berkowit@spoof_silcom.com,
"Paul Berkowitz" <berkowit@spoof_silcom.com> wrote:

> On 8/3/04 8:25 PM, in article 1ghylvi.nwwqa1rwa43kN%matt@tidbits.com, "matt
> neuburg" <matt@tidbits.com> wrote:
>
>> Brett Zamir <b.zamir@comcast.net> wrote:
>>
>>> 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.
>
> 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.


Re: Scripting rules by Paul

Paul
Wed Aug 04 12:11:54 CDT 2004

On 8/3/04 10:54 PM, in article BD35E462.1772%b.zamir@comcast.net, "Brett
Zamir" <b.zamir@comcast.net> wrote:

> 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.