Hi,

I have proudly finished my very first AppleScript to turn a schedule on or
off, but it is not working properly.

My situation is that when I am at work, I plug my iBook into the intranet
and have access to an internet connection that is much faster than home. In
this case, I like to have a schedule turned on that will check my email
every 15 minutes. But when I am at home on dial up, I want this schedule
turned off.

I wrote a script that I use to toggle the schedule, if it is on, then turn
it off, if it is off, then turn it on.

It does turn the schedule on (when you look inside the Tools:Schedules
window, there is the appropriate tick (or no tick) in the box of the
required schedule. But it doesn't actually activate/deactivate the schedule.

For example, the schedule is off at the moment. I use my script to toggle it
and it is now on. The check mark is next the schedule. But, there is no time
mentioned in the Next Run column. It is not until I edit the schedule, close
it without making any changes (I do confirm the Enabled box is checked) and
then it says 'Today 10:16' meaning that it will check the mail in 15 minutes
time. If I just wait without opening and closing the schedule, it doesn't
actually get my mail.

Is there a command I am supposed to use to activate, as well as turn on the
schedule?

Thanks,

Robyn



Here is my code:

tell application "Microsoft Entourage"
    set list_sched to (every schedule)
    
    repeat with sched in list_sched
        set sn to name of sched
        
        if sn contains "Check mail every 15 mins" then
            set toggle to enabled of sched
            -- display dialog "Enabled is set to :  " & toggle
            
            if toggle is false then
                set enabled of sched to true
                display dialog "Mail will be retrieved every 15 minutes."
            else if toggle is true then
                set enabled of sched to false
            end if
            
            set toggle to enabled of sched
            
        end if
    end repeat
    
end tell


-- 
To unsubscribe:                     
<mailto:[EMAIL PROTECTED]>
archives:       
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to