Testing for Time (Script Control)

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

Testing for Time (Script Control)

Post by Tourless » Tue Apr 11, 2023 8:12 pm

Hi Folks.

My latest script runs hourly 24x7. I'd like to limit that to run between a set of hours, 6am - 10pm. Since that level of scheduling control does not exist in the Run When tab, I'm trying this but I've got something wrong... most likely syntax. Can someone show me the syntax error of my ways?

Code: Select all

Hour>theHour
If> theHour > 06 AND < 22
Goto>T1Test
Else
Goto>Exit
EndIf

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1380
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Testing for Time (Script Control)

Post by Dorian (MJT support) » Tue Apr 11, 2023 8:48 pm

The help file is your friend. There are examples of complex expressions here.

However, you can do that via the scheduler anyway.

>Run When > Advanced Options >Stop and reset after 06 : 01

Should do exactly what you want.
Yes, we have a Custom Scripting Service. Message me or go here

Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

Re: Testing for Time (Script Control)

Post by Tourless » Thu Apr 13, 2023 2:32 pm

Yeah, you're right. My problem is I'm usually moving too fast to stop and search for answers. I do try to bring a semi-educated question to the table but it doesn't always work out that way :) Anyway, thank you. I'm always grateful to the people who know more than I do and are willing to help educate those of us in need.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1380
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Testing for Time (Script Control)

Post by Dorian (MJT support) » Thu Apr 13, 2023 2:53 pm

I think the beauty of the help file is, it's instant.

Type your command in the editor, press F1 for context sensitive help, and there it is, complete with examples.

Sometimes this job is as much about helping people find help as it is about showing them how to do the thing they're asking about. :)

(I hope that doesn't sound rude).
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts