Hello I know that I can use something like Applescript to control different aspects of operating systems like keyboard inputs:
osascript -e 'tell application "System Events" to key code 45'
or mouse clicks:
osascript -e 'tell app "System Events" to click at {100,200}'
and many other features like volume up/down, open/close app, go to url in web browser.
Now I consider how could I control this without Applescript on OS X (macOS) I think about some low level API, preferably in C (eventually in Objective-C) that could do similar things. I am interested mainly in mouse/keyboard/pad software control (like If I will be writing virtual keyboard), opening apps, invoking shortcuts in apps. I think I will use Applescript at the end and execute it's scripts via C. But I am also interested in more low level programming and libraries in C?
What is the best way to execute such apple scripts from other languages like C? I think about something like
system(osascript -e 'tell application "System Events" to key code 45')
But maybe there are better functions/libraries like osascript("here cmd");