├── SayThis.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── armin.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── SayThis ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj └── Main.storyboard ├── ContentView.swift ├── Info.plist ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json ├── Process-launch.swift └── SayThis.entitlements /SayThis.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 53; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C66ED3122A8A15BD00E2FE12 /* Process-launch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66ED3112A8A15BD00E2FE12 /* Process-launch.swift */; }; 11 | C6E24F4323954CE40052BF3B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6E24F4223954CE40052BF3B /* AppDelegate.swift */; }; 12 | C6E24F4523954CE40052BF3B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6E24F4423954CE40052BF3B /* ContentView.swift */; }; 13 | C6E24F4723954CE60052BF3B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C6E24F4623954CE60052BF3B /* Assets.xcassets */; }; 14 | C6E24F4A23954CE60052BF3B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C6E24F4923954CE60052BF3B /* Preview Assets.xcassets */; }; 15 | C6E24F4D23954CE60052BF3B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C6E24F4B23954CE60052BF3B /* Main.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | C66ED3112A8A15BD00E2FE12 /* Process-launch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Process-launch.swift"; sourceTree = ""; }; 20 | C6E24F3F23954CE40052BF3B /* SayThis.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SayThis.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | C6E24F4223954CE40052BF3B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | C6E24F4423954CE40052BF3B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 23 | C6E24F4623954CE60052BF3B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | C6E24F4923954CE60052BF3B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 25 | C6E24F4C23954CE60052BF3B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | C6E24F4E23954CE60052BF3B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | C6E24F4F23954CE60052BF3B /* SayThis.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SayThis.entitlements; sourceTree = ""; }; 28 | /* End PBXFileReference section */ 29 | 30 | /* Begin PBXFrameworksBuildPhase section */ 31 | C6E24F3C23954CE40052BF3B /* Frameworks */ = { 32 | isa = PBXFrameworksBuildPhase; 33 | buildActionMask = 2147483647; 34 | files = ( 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXFrameworksBuildPhase section */ 39 | 40 | /* Begin PBXGroup section */ 41 | C6E24F3623954CE40052BF3B = { 42 | isa = PBXGroup; 43 | children = ( 44 | C6E24F4123954CE40052BF3B /* SayThis */, 45 | C6E24F4023954CE40052BF3B /* Products */, 46 | ); 47 | sourceTree = ""; 48 | }; 49 | C6E24F4023954CE40052BF3B /* Products */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | C6E24F3F23954CE40052BF3B /* SayThis.app */, 53 | ); 54 | name = Products; 55 | sourceTree = ""; 56 | }; 57 | C6E24F4123954CE40052BF3B /* SayThis */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | C6E24F4223954CE40052BF3B /* AppDelegate.swift */, 61 | C6E24F4423954CE40052BF3B /* ContentView.swift */, 62 | C66ED3112A8A15BD00E2FE12 /* Process-launch.swift */, 63 | C6E24F4623954CE60052BF3B /* Assets.xcassets */, 64 | C6E24F4B23954CE60052BF3B /* Main.storyboard */, 65 | C6E24F4E23954CE60052BF3B /* Info.plist */, 66 | C6E24F4F23954CE60052BF3B /* SayThis.entitlements */, 67 | C6E24F4823954CE60052BF3B /* Preview Content */, 68 | ); 69 | path = SayThis; 70 | sourceTree = ""; 71 | }; 72 | C6E24F4823954CE60052BF3B /* Preview Content */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | C6E24F4923954CE60052BF3B /* Preview Assets.xcassets */, 76 | ); 77 | path = "Preview Content"; 78 | sourceTree = ""; 79 | }; 80 | /* End PBXGroup section */ 81 | 82 | /* Begin PBXNativeTarget section */ 83 | C6E24F3E23954CE40052BF3B /* SayThis */ = { 84 | isa = PBXNativeTarget; 85 | buildConfigurationList = C6E24F5223954CE60052BF3B /* Build configuration list for PBXNativeTarget "SayThis" */; 86 | buildPhases = ( 87 | C6E24F3B23954CE40052BF3B /* Sources */, 88 | C6E24F3C23954CE40052BF3B /* Frameworks */, 89 | C6E24F3D23954CE40052BF3B /* Resources */, 90 | ); 91 | buildRules = ( 92 | ); 93 | dependencies = ( 94 | ); 95 | name = SayThis; 96 | productName = SayThis; 97 | productReference = C6E24F3F23954CE40052BF3B /* SayThis.app */; 98 | productType = "com.apple.product-type.application"; 99 | }; 100 | /* End PBXNativeTarget section */ 101 | 102 | /* Begin PBXProject section */ 103 | C6E24F3723954CE40052BF3B /* Project object */ = { 104 | isa = PBXProject; 105 | attributes = { 106 | BuildIndependentTargetsInParallel = YES; 107 | LastSwiftUpdateCheck = 1120; 108 | LastUpgradeCheck = 1430; 109 | ORGANIZATIONNAME = "Scripting OS X"; 110 | TargetAttributes = { 111 | C6E24F3E23954CE40052BF3B = { 112 | CreatedOnToolsVersion = 11.2.1; 113 | }; 114 | }; 115 | }; 116 | buildConfigurationList = C6E24F3A23954CE40052BF3B /* Build configuration list for PBXProject "SayThis" */; 117 | compatibilityVersion = "Xcode 9.3"; 118 | developmentRegion = en; 119 | hasScannedForEncodings = 0; 120 | knownRegions = ( 121 | en, 122 | Base, 123 | ); 124 | mainGroup = C6E24F3623954CE40052BF3B; 125 | productRefGroup = C6E24F4023954CE40052BF3B /* Products */; 126 | projectDirPath = ""; 127 | projectRoot = ""; 128 | targets = ( 129 | C6E24F3E23954CE40052BF3B /* SayThis */, 130 | ); 131 | }; 132 | /* End PBXProject section */ 133 | 134 | /* Begin PBXResourcesBuildPhase section */ 135 | C6E24F3D23954CE40052BF3B /* Resources */ = { 136 | isa = PBXResourcesBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | C6E24F4D23954CE60052BF3B /* Main.storyboard in Resources */, 140 | C6E24F4A23954CE60052BF3B /* Preview Assets.xcassets in Resources */, 141 | C6E24F4723954CE60052BF3B /* Assets.xcassets in Resources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXResourcesBuildPhase section */ 146 | 147 | /* Begin PBXSourcesBuildPhase section */ 148 | C6E24F3B23954CE40052BF3B /* Sources */ = { 149 | isa = PBXSourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | C66ED3122A8A15BD00E2FE12 /* Process-launch.swift in Sources */, 153 | C6E24F4523954CE40052BF3B /* ContentView.swift in Sources */, 154 | C6E24F4323954CE40052BF3B /* AppDelegate.swift in Sources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXSourcesBuildPhase section */ 159 | 160 | /* Begin PBXVariantGroup section */ 161 | C6E24F4B23954CE60052BF3B /* Main.storyboard */ = { 162 | isa = PBXVariantGroup; 163 | children = ( 164 | C6E24F4C23954CE60052BF3B /* Base */, 165 | ); 166 | name = Main.storyboard; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXVariantGroup section */ 170 | 171 | /* Begin XCBuildConfiguration section */ 172 | C6E24F5023954CE60052BF3B /* Debug */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | CLANG_ANALYZER_NONNULL = YES; 177 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 179 | CLANG_CXX_LIBRARY = "libc++"; 180 | CLANG_ENABLE_MODULES = YES; 181 | CLANG_ENABLE_OBJC_ARC = YES; 182 | CLANG_ENABLE_OBJC_WEAK = YES; 183 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 184 | CLANG_WARN_BOOL_CONVERSION = YES; 185 | CLANG_WARN_COMMA = YES; 186 | CLANG_WARN_CONSTANT_CONVERSION = YES; 187 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 188 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 189 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 190 | CLANG_WARN_EMPTY_BODY = YES; 191 | CLANG_WARN_ENUM_CONVERSION = YES; 192 | CLANG_WARN_INFINITE_RECURSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 195 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 196 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 198 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 199 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 200 | CLANG_WARN_STRICT_PROTOTYPES = YES; 201 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 202 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 203 | CLANG_WARN_UNREACHABLE_CODE = YES; 204 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 205 | COPY_PHASE_STRIP = NO; 206 | DEAD_CODE_STRIPPING = YES; 207 | DEBUG_INFORMATION_FORMAT = dwarf; 208 | ENABLE_STRICT_OBJC_MSGSEND = YES; 209 | ENABLE_TESTABILITY = YES; 210 | GCC_C_LANGUAGE_STANDARD = gnu11; 211 | GCC_DYNAMIC_NO_PIC = NO; 212 | GCC_NO_COMMON_BLOCKS = YES; 213 | GCC_OPTIMIZATION_LEVEL = 0; 214 | GCC_PREPROCESSOR_DEFINITIONS = ( 215 | "DEBUG=1", 216 | "$(inherited)", 217 | ); 218 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 219 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 220 | GCC_WARN_UNDECLARED_SELECTOR = YES; 221 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 222 | GCC_WARN_UNUSED_FUNCTION = YES; 223 | GCC_WARN_UNUSED_VARIABLE = YES; 224 | MACOSX_DEPLOYMENT_TARGET = 10.15; 225 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 226 | MTL_FAST_MATH = YES; 227 | ONLY_ACTIVE_ARCH = YES; 228 | SDKROOT = macosx; 229 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 230 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 231 | }; 232 | name = Debug; 233 | }; 234 | C6E24F5123954CE60052BF3B /* Release */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 240 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 241 | CLANG_CXX_LIBRARY = "libc++"; 242 | CLANG_ENABLE_MODULES = YES; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | CLANG_ENABLE_OBJC_WEAK = YES; 245 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 246 | CLANG_WARN_BOOL_CONVERSION = YES; 247 | CLANG_WARN_COMMA = YES; 248 | CLANG_WARN_CONSTANT_CONVERSION = YES; 249 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 250 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 251 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 252 | CLANG_WARN_EMPTY_BODY = YES; 253 | CLANG_WARN_ENUM_CONVERSION = YES; 254 | CLANG_WARN_INFINITE_RECURSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 257 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 258 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 261 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 262 | CLANG_WARN_STRICT_PROTOTYPES = YES; 263 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 264 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 265 | CLANG_WARN_UNREACHABLE_CODE = YES; 266 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 267 | COPY_PHASE_STRIP = NO; 268 | DEAD_CODE_STRIPPING = YES; 269 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 270 | ENABLE_NS_ASSERTIONS = NO; 271 | ENABLE_STRICT_OBJC_MSGSEND = YES; 272 | GCC_C_LANGUAGE_STANDARD = gnu11; 273 | GCC_NO_COMMON_BLOCKS = YES; 274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 276 | GCC_WARN_UNDECLARED_SELECTOR = YES; 277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 278 | GCC_WARN_UNUSED_FUNCTION = YES; 279 | GCC_WARN_UNUSED_VARIABLE = YES; 280 | MACOSX_DEPLOYMENT_TARGET = 10.15; 281 | MTL_ENABLE_DEBUG_INFO = NO; 282 | MTL_FAST_MATH = YES; 283 | SDKROOT = macosx; 284 | SWIFT_COMPILATION_MODE = wholemodule; 285 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 286 | }; 287 | name = Release; 288 | }; 289 | C6E24F5323954CE60052BF3B /* Debug */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 293 | CODE_SIGN_ENTITLEMENTS = SayThis/SayThis.entitlements; 294 | CODE_SIGN_STYLE = Automatic; 295 | COMBINE_HIDPI_IMAGES = YES; 296 | DEAD_CODE_STRIPPING = YES; 297 | DEVELOPMENT_ASSET_PATHS = "\"SayThis/Preview Content\""; 298 | DEVELOPMENT_TEAM = JME5BW3F3R; 299 | ENABLE_HARDENED_RUNTIME = YES; 300 | ENABLE_PREVIEWS = YES; 301 | INFOPLIST_FILE = SayThis/Info.plist; 302 | LD_RUNPATH_SEARCH_PATHS = ( 303 | "$(inherited)", 304 | "@executable_path/../Frameworks", 305 | ); 306 | MACOSX_DEPLOYMENT_TARGET = 12.0; 307 | PRODUCT_BUNDLE_IDENTIFIER = com.scriptingosx.SayThis; 308 | PRODUCT_NAME = "$(TARGET_NAME)"; 309 | SWIFT_VERSION = 5.0; 310 | }; 311 | name = Debug; 312 | }; 313 | C6E24F5423954CE60052BF3B /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 317 | CODE_SIGN_ENTITLEMENTS = SayThis/SayThis.entitlements; 318 | CODE_SIGN_STYLE = Automatic; 319 | COMBINE_HIDPI_IMAGES = YES; 320 | DEAD_CODE_STRIPPING = YES; 321 | DEVELOPMENT_ASSET_PATHS = "\"SayThis/Preview Content\""; 322 | DEVELOPMENT_TEAM = JME5BW3F3R; 323 | ENABLE_HARDENED_RUNTIME = YES; 324 | ENABLE_PREVIEWS = YES; 325 | INFOPLIST_FILE = SayThis/Info.plist; 326 | LD_RUNPATH_SEARCH_PATHS = ( 327 | "$(inherited)", 328 | "@executable_path/../Frameworks", 329 | ); 330 | MACOSX_DEPLOYMENT_TARGET = 12.0; 331 | PRODUCT_BUNDLE_IDENTIFIER = com.scriptingosx.SayThis; 332 | PRODUCT_NAME = "$(TARGET_NAME)"; 333 | SWIFT_VERSION = 5.0; 334 | }; 335 | name = Release; 336 | }; 337 | /* End XCBuildConfiguration section */ 338 | 339 | /* Begin XCConfigurationList section */ 340 | C6E24F3A23954CE40052BF3B /* Build configuration list for PBXProject "SayThis" */ = { 341 | isa = XCConfigurationList; 342 | buildConfigurations = ( 343 | C6E24F5023954CE60052BF3B /* Debug */, 344 | C6E24F5123954CE60052BF3B /* Release */, 345 | ); 346 | defaultConfigurationIsVisible = 0; 347 | defaultConfigurationName = Release; 348 | }; 349 | C6E24F5223954CE60052BF3B /* Build configuration list for PBXNativeTarget "SayThis" */ = { 350 | isa = XCConfigurationList; 351 | buildConfigurations = ( 352 | C6E24F5323954CE60052BF3B /* Debug */, 353 | C6E24F5423954CE60052BF3B /* Release */, 354 | ); 355 | defaultConfigurationIsVisible = 0; 356 | defaultConfigurationName = Release; 357 | }; 358 | /* End XCConfigurationList section */ 359 | }; 360 | rootObject = C6E24F3723954CE40052BF3B /* Project object */; 361 | } 362 | -------------------------------------------------------------------------------- /SayThis.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SayThis.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SayThis.xcodeproj/xcuserdata/armin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SayThis.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SayThis/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SayThis 4 | // 5 | // Created by Armin Briegel on 02.12.19. 6 | // Copyright © 2019 Scripting OS X. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SwiftUI 11 | 12 | @NSApplicationMain 13 | class AppDelegate: NSObject, NSApplicationDelegate { 14 | 15 | var window: NSWindow! 16 | 17 | 18 | func applicationDidFinishLaunching(_ aNotification: Notification) { 19 | // Create the SwiftUI view that provides the window contents. 20 | let contentView = ContentView() 21 | 22 | // Create the window and set the content view. 23 | window = NSWindow( 24 | contentRect: NSRect(x: 0, y: 0, width: 480, height: 300), 25 | styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], 26 | backing: .buffered, defer: false) 27 | window.center() 28 | window.setFrameAutosaveName("Main Window") 29 | window.contentView = NSHostingView(rootView: contentView) 30 | window.makeKeyAndOrderFront(nil) 31 | } 32 | 33 | func applicationWillTerminate(_ aNotification: Notification) { 34 | // Insert code here to tear down your application 35 | } 36 | 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /SayThis/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /SayThis/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SayThis/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | Default 529 | 530 | 531 | 532 | 533 | 534 | 535 | Left to Right 536 | 537 | 538 | 539 | 540 | 541 | 542 | Right to Left 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | Default 554 | 555 | 556 | 557 | 558 | 559 | 560 | Left to Right 561 | 562 | 563 | 564 | 565 | 566 | 567 | Right to Left 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | -------------------------------------------------------------------------------- /SayThis/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SayThis 4 | // 5 | // Created by Armin Briegel on 02.12.19. 6 | // Copyright © 2019 Scripting OS X. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ContentView: View { 12 | @State var message = "Hello, World" 13 | @State var isRunning = false 14 | 15 | @State var voices: [String] = [] 16 | @State var selectedVoice: String = "System Default" 17 | 18 | var body: some View { 19 | VStack { 20 | Text("SayThis") 21 | .font(.largeTitle) 22 | .padding() 23 | Picker(selection: $selectedVoice, label: Text("Voice:")) { 24 | Text("System Default").tag("System Default") 25 | Divider() 26 | ForEach(voices, id: \.self) { Text($0) } 27 | } 28 | HStack { 29 | TextField("Message", text: $message) 30 | Button("Say") { 31 | Task { 32 | await runCommand() 33 | } 34 | } 35 | .disabled(isRunning) 36 | } 37 | } 38 | .padding() 39 | .frame(maxWidth: .infinity, maxHeight: .infinity) 40 | .task { 41 | guard let (_, outData, _) = try? await Process.launch( 42 | path: "/usr/bin/say", 43 | arguments: ["-v", "?"] 44 | ) else { return } 45 | 46 | let output = String(data: outData, encoding: .utf8) ?? "" 47 | voices = parseVoices(output) 48 | } 49 | } 50 | 51 | func parseVoices(_ output: String) -> [String] { 52 | output 53 | .components(separatedBy: "\n") 54 | .map { 55 | $0 56 | .components(separatedBy: "#") 57 | .first? 58 | .trimmingCharacters(in: .whitespaces) 59 | .components(separatedBy: CharacterSet.whitespaces) 60 | .dropLast() 61 | .filter { !$0.isEmpty } 62 | .joined(separator: " ") 63 | ?? "" 64 | } 65 | .filter { !$0.isEmpty } 66 | } 67 | 68 | func runCommand() async { 69 | var arguments = [message] 70 | if selectedVoice != "System Default" { 71 | arguments.append(contentsOf: ["-v", selectedVoice]) 72 | } 73 | self.isRunning = true 74 | let _ = try? await Process.launch(path: "/usr/bin/say", arguments: arguments) 75 | self.isRunning = false 76 | } 77 | 78 | } 79 | 80 | 81 | struct ContentView_Previews: PreviewProvider { 82 | static var previews: some View { 83 | ContentView() 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /SayThis/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2019 Scripting OS X. All rights reserved. 27 | NSMainStoryboardFile 28 | Main 29 | NSPrincipalClass 30 | NSApplication 31 | NSSupportsAutomaticTermination 32 | 33 | NSSupportsSuddenTermination 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SayThis/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SayThis/Process-launch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Process-launch.swift 3 | // SayThis 4 | // 5 | // Created by Armin Briegel on 2023-08-14. 6 | // Copyright © 2023 Scripting OS X. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Process { 12 | @discardableResult 13 | static func launch( 14 | path: String, 15 | arguments: [String] = [], 16 | terminationHandler: @escaping (Int, Data, Data) -> Void 17 | ) throws -> Process { 18 | let process = Process() 19 | let outPipe = Pipe() 20 | let errorPipe = Pipe() 21 | process.standardOutput = outPipe 22 | process.standardError = errorPipe 23 | process.arguments = arguments 24 | process.launchPath = path 25 | process.terminationHandler = { process in 26 | let outData = outPipe.fileHandleForReading.readDataToEndOfFile() 27 | let errorData = errorPipe.fileHandleForReading.readDataToEndOfFile() 28 | let exitCode = Int(process.terminationStatus) 29 | terminationHandler(exitCode, outData, errorData) 30 | } 31 | try process.run() 32 | return process 33 | } 34 | 35 | @discardableResult 36 | static func launch( 37 | path: String, 38 | arguments: [String] = [] 39 | ) async throws -> (exitCode: Int, standardOutput: Data, standardError: Data) { 40 | try await withCheckedThrowingContinuation { continuation in 41 | do { 42 | try launch(path: path, arguments: arguments) { exitCode, outData, errData in 43 | continuation.resume(returning: (exitCode, outData, errData)) 44 | } 45 | } catch let error { 46 | continuation.resume(throwing: error) 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SayThis/SayThis.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | --------------------------------------------------------------------------------