Mapping F-keys to specific actions in an app

The solution was to create an Automator application with the same AppleScript. For some reason, Sonoma has no trouble with Assistive access for Automator applications.