Not authorized to send Apple events to Finder. (error -1743)

I know that this question had been asked and answered several times.
But I stuck again.

I created a new ASobjC app in Xcode which uses a simple tell block like

tell application "Finder"
	set myPath to POSIX path of (application file id "com.apple.Notes" as Unicode text) as string
end tell

I get the error:
Not authorized to send Apple events to Finder. (error -1743)

So as recommended I added a
NSAppleEventsUsageDescription

To the info.plist as I did in former times.
But no change

What did I do wrong?

I’ve just tried your code in Script Debugger. I got a requester seeking permission to control Finder for which I clicked on OK. Then it ran. Ran a second time with no errors or requesters.

But, do you need to use Finder to get the path to the Notes app ? For example, this works for me:

set myPath to path to application "Notes" as string
set myPath_posix to POSIX path of myPath

That’s using Standard Additions. Although, I still got a requester seeking permission to control Notes.

The -1743 error occurred a lot in macOS 12.3. Have you updated to 12.3.1 or 12.4 ?

Thanks Garry,

The issue is not this code. It’s about using tell blocks for “Finder” or “System Events”
And the usage of those in an application created in Xcode.

So as you said running that code in Script Debugger is no problem.

I use Big Sur 11.6.6

Andreas