Is “execute” an AppleScript keyword?

I have noticed that AppleScript Editor colors “execute” as a command. Also, the following is a valid script (compiles and runs):


script Foo
	display dialog "Foo"
end script

on baz()
	display dialog "bar"
end baz

execute
execute 3
execute {3, 4, 5}
execute "abc"
execute Foo
execute baz()

The following, however, results in “variable s not defined”:


set s to execute "a"
s

I was not able to find any documentation about “execute”. Is it an AppleScript keyword? If so, what is its purpose?

execute (verb)Execute the document. (from Script Editor Suite)
function syntax
set theResult to execute reference
result
anything
parameters
Parameter
Required
Type
Description
direct parameter required reference the object for the command

(from Script Editor Suite) :slight_smile:

Oh, silly me! It didn’t occur to me that a command targets AppleScript Editor by default! Thanks!