Originally, AppleScript invoked an application's internal functionality through an AppleScript dictionary of terms.
Operations such as clicking buttons and operating menus depend on the state of the application being operated, so various know-how is required.
It's normal to write out system information as CSV data.
All the know-how about GUI Scripting is summarized in an e-book, so it may be helpful.
https://piyomarusoft.booth.pm/items/4230018
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: