NSAppleScript
-

How to Run sudo pmset From a Swift App (No Deprecated APIs)
Run pmset with root rights from a Swift macOS app: read the schedule without privileges, then write it through NSAppleScript’s admin prompt.

Run pmset with root rights from a Swift macOS app: read the schedule without privileges, then write it through NSAppleScript’s admin prompt.