Why doesn't with timeout cover the whole scope?

If you have something like

on run {}
	with timeout of 600 seconds
		myHandler()
	end timeout
end run

and a step in myHandler() then takes more than 60 seconds (the default timeout limit) the script is interrupted. Why doesn’t the handler inherit the environment it is called from? Can this be changed?

A with timeout statement applies only to commands sent to application objects, not to commands sent to the application that is running the script.

FWIW, I think the default is 120 seconds. Perhaps it has changed though.

From Control Statements in the ASLG:

with timeout Statements

You can use a with timeout statement to control how long AppleScript waits for a command to execute before timing out. By default, when an application fails to respond to a command, AppleScript waits for two minutes before reporting an error and halting execution.

I’m not sure I follow you here. Could you give an example?

Thank you.

You are right. My mistake.