Remote Apple Events: Finder got an error: Unable to authenticate user.

Hello all, I’m currently playing around with some remote apple events but I keep on getting this error: “Finder got an error: Unable to authenticate user.” number -927. Here is my script:

set remoteMachine to "eppc://"
tell application "Finder" of machine remoteMachine
	say "Hello"
end tell

You have to put the credentials in the URL.

set remoteMachine to "eppc://username:password@"

tell application "Finder" of machine (get "eppc://")
	using terms from application "Finder"
		say "Hello"
	end using terms from
end tell

This form allows the script to compile even if the remote machine isn’t available on the network for some reason. Using the code (get “eppc://…”) prevents AppleScript from identifying the machine during compilation. The script will compile using the terms taken from the application identified by the using terms from block, and the real machine will be evaluated and found only when the script runs.

Of course you should add to keychain password and username for remote machine early. Embedding password and username in the code is unsecure. Have password and username to remote machine?

If you have it, do not show it to us. And if not, then it’s time to visit and add yourself to the users of the remote computer. Or ask a friend to add you in an urgent telegram.

Thank you both so much for the help!

The script compiles anyway. The availability of the host is not checked at compile time.

The using terms from block is pointless as say is not part of the Finder dictionary

Turn off the host from network to check.

Yes you are right. But I assume that the user will use remote applications for other tasks as well, except to say “Hello”.