call an action in cocoa app from applescript

I have a cocoa app.
Now I need to call an action (i have a button called update) from filemaker.
I have to write sdef file etc… or can I find an easier method??

I’ve read a thread where someone explain that in apple studio apps is possible to call action so:

tell application “my app”
tell button “button” perform action
end tell

I’m trying,
I can launch app but I’ve error on performing action.

I would know if this method is correct also for cocoa apps, or if I need something else…


have you tried this?

tell button "button" of window 1to perform action