allowing applescript to communicate with unity

hello

I am using a program that has the ability to run apple scripts. one of the scripts I am using produces keystrokes.

apple script example:

tell application “System Events”
tell application “System Events” to keystroke “v”
end tell

this works fine except for when i’m in a unity app. I am using the v key to rotate camera left and the B key to rotate right but unity seems to disregard the apple script.

any help would be extremely appreciated.

thank you

Make sure Unity is the frontmost application:

tell application "Unity" to activate

You may also need to add a brief delay between operations to make sure they have time to process:

delay 0.2

how to connect applescript editor with unity