Calling a function from within a Tell Statement

Why does the following not work:


on dialog_function()
display dialog "Hello World"
end dialog_function
tell application "Adobe Acrobat Professional"
dialog_function()
end tell

How do I create a function that can be run from within a tell statement?

Just add the keyword “my” before calling the method

on dialog_function()
	display dialog "Hello World"
end dialog_function
tell application "Adobe Acrobat Professional"
	my dialog_function()
end tell

Sweet! Thanks so much for that!