Will a non stop repeating applescript cause problems?

I have an applescript that I want to run constantly that closes dialog boxes in Photoshop. I have never tried running a non stop repeating script before…

Has anyone done this? Do you foresee any potential problems?

Thanks!

repeat
	if application "Adobe Photoshop CC 2018" is running then
		try
			tell application "System Events" to tell process "Adobe Photoshop CC 2018"
				tell button "Stop" of window "Adobe Photoshop" to perform action "AXPress"
			end tell
			delay 30
		end try
	end if
end repeat

I may have found the answer…

I wrapped the process inside an ‘on idle’ statement and saved it as an App…
I believe this is what I’m looking for.

Even if you found the solution, to answer your question: It depends on the code and there is no documentation on how to write it. It completely depends on how much data is gathered and stored from your script and if the garbage collector works flawless. In itself an endless repeat is not a problem but the code inside the repeat loop could consume too much memory over time slowing down your machine. The same applies for idle handlers.

In your case I don’t foresee any problems since you’re practically using minimal AppleScript code and mainly sending AppleEvents.

Thank you sir. I appreciate it…