4 class RecordCommand: NSScriptCommand {
5 override func performDefaultImplementation() -> Any? {
6 print("AAAH \(self.directParameter)")
8 guard let args = self.directParameter as? [String: Any] else {
12 print("AAH COMMANDS \(args)")
14 // Here you can extract the parameters from the args dictionary and configure your settings
15 let x = args["x"] as? Int
16 let y = args["y"] as? Int
17 let width = args["width"] as? Int
18 let height = args["height"] as? Int
19 let preventResize = args["prevent_resize"] as? Bool
20 let preventMove = args["prevent_move"] as? Bool
21 let fps = args["fps"] as? Int
22 let outputs = OutputFormatSetting(args["outputs"] as? String ?? "")
23 let backend = URL(string: args["backend"] as? String ?? "")
24 let backendOutput = OutputFormatSetting(args["backend_output"] as? String ?? "")
25 let keepLocalFiles = args["keep_local_files"] as? Bool
26 let autoStart = args["auto_start"] as? Bool
27 let maxLength = args["max_length"] as? Int
29 print("AAH WIDTH \(width)")
31 var skipBackend = false
32 if let backendString = args["backend"] as? String {
33 if backendString == "" {
38 let config = RecordAction(
44 preventResize: preventResize,
45 preventMove: preventMove,
49 backendOutput: backendOutput,
50 keepLocalFiles: keepLocalFiles,
52 skipBackend: skipBackend,
56 NotificationCenter.default.post(name: .setCaptureSessionConfiguration, object: nil, userInfo: [
59 NotificationCenter.default.post(name: .startAreaSelection, object: nil, userInfo: nil)
61 // Return a result if needed