Write script to only run durning non business hours

I looked a little and have not been able to find any advice on this already. I have a script set up to email me whenever a motion trigger is tripped on a security camera in our server room at our IT office. The script itself works great, except for I get about 40 emails a day because people at work are working in the server room. Is there a way I can add an if/then statement to the script that will cause it to only send the emails if the trigger is tripped outside of normal business hours? Thanks ahead of time for your help.


Moved the topic to the appropriate forum.

My first idea regarding the problem:

set curdate to current date
set curhour to hours of curdate

if curhour is not in {8, 9, 10, 11, 12, 13, 14, 15, 16, 17} then
	tell me
		display dialog "Currently no business!"
	end tell
end if

Thanks for moving the post, sorry for having it in the wrong spot.

That seems to do exactly what I wanted it to do. I’ll just change a few things and it should work. Thank you so much.