From 153f3309127a4f9d898310224a467d11eef0f2ff Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Wed, 2 Aug 2023 18:01:42 +0200 Subject: Attempt more AppleScript support --- Captura/Scripting/Captura.sdef | 25 +++++++++++++++---------- Captura/Scripting/RecordCommand.swift | 9 +-------- Captura/Scripting/ScriptedPreferences.swift | 1 + 3 files changed, 17 insertions(+), 18 deletions(-) (limited to 'Captura/Scripting') diff --git a/Captura/Scripting/Captura.sdef b/Captura/Scripting/Captura.sdef index 82cf06f..ca49d17 100644 --- a/Captura/Scripting/Captura.sdef +++ b/Captura/Scripting/Captura.sdef @@ -1,19 +1,24 @@ - + + + + + + - - - + + + - - - - - + + + + + @@ -24,7 +29,7 @@ - + diff --git a/Captura/Scripting/RecordCommand.swift b/Captura/Scripting/RecordCommand.swift index 8db2656..9d25b59 100644 --- a/Captura/Scripting/RecordCommand.swift +++ b/Captura/Scripting/RecordCommand.swift @@ -3,13 +3,8 @@ import Foundation @objc(RecordCommand) class RecordCommand: NSScriptCommand { override func performDefaultImplementation() -> Any? { - print("AAAH \(self.directParameter)") - guard let args = self.directParameter as? [String: Any] else { - return nil - } - - print("AAH COMMANDS \(args)") + let args = self.directParameter as? [String: Any] ?? [:] // Here you can extract the parameters from the args dictionary and configure your settings let x = args["x"] as? Int @@ -26,8 +21,6 @@ class RecordCommand: NSScriptCommand { let autoStart = args["auto_start"] as? Bool let maxLength = args["max_length"] as? Int - print("AAH WIDTH \(width)") - var skipBackend = false if let backendString = args["backend"] as? String { if backendString == "" { diff --git a/Captura/Scripting/ScriptedPreferences.swift b/Captura/Scripting/ScriptedPreferences.swift index b6aa719..2606ff7 100644 --- a/Captura/Scripting/ScriptedPreferences.swift +++ b/Captura/Scripting/ScriptedPreferences.swift @@ -1,5 +1,6 @@ import Foundation +@objc(ScriptedPreferences) class ScriptedPreferences: NSObject { @objc dynamic var fps: Int { get { -- cgit