I'm trying to make a prompt work for Accessibility in OS X, but the constant is a weird format and don't know how to make it work.
var options: [String:String] = [:]
options[kAXTrustedCheckOptionPrompt] = "YES"
You're passing the string "YES" when you mean to pass a boolean. You can't do that. Since this is the only value we're passing, we can let Swift do all the magical bridging for us from
import Foundation import ApplicationServices var options: [String: Bool] = [:] options[kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String] = true print(AXIsProcessTrustedWithOptions(options))