# Script Executing trouble

**URL:** <https://forum.inductiveautomation.com/t/script-executing-trouble/60625>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 10, 2022, 4:51pm UTC](https://forum.inductiveautomation.com/t/script-executing-trouble/60625 "2022-06-10T16:51:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 10, 2022, 5:02pm UTC](https://forum.inductiveautomation.com/t/script-executing-trouble/60625/2 "2022-06-10T17:02:37Z")

</div>

This should probably be a Gateway Scheduled Event Script.

Either way, I just learned about a better way of doing this:

> [@Browse tags printing folder](https://forum.inductiveautomation.com/t/browse-tags-printing-folder/60498/20):
>
> from com.inductiveautomation.ignition.common import TypeUtilities # Grabs current Date and Time getDateTime = system.date.now() # Returns current hour in a 0-23 format getHour = system.date.getHour24(getDateTime) # Creates list to store tag paths paths = [] # Checks if time is Midnight if getHour == 7: # Gets all tags in folder sub structure and writes to an array tags = system.tag.browseTags(parentPath="folder", recursive = True) for tag in tags: if not tag.isFolder(): …

Note that unless you have filtered the code prior to the code you shared, it will execute when the value changes, but also when the quality changes, so you probably want to insure that the value has actually made a False to True transition.

Also, verify that your Gateway, Database, and Local machine all have the same Date Time settings.

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-executing-trouble/60625)._
