{"id":26662988,"url":"https://github.com/hhas/swiftautomation","last_synced_at":"2025-04-11T18:24:15.632Z","repository":{"id":41863581,"uuid":"177770398","full_name":"hhas/SwiftAutomation","owner":"hhas","description":"High-level Apple event framework for Swift. Currently implements client-side; server-side TBD.","archived":false,"fork":false,"pushed_at":"2023-10-07T01:39:38.000Z","size":2653,"stargazers_count":71,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T18:24:07.754Z","etag":null,"topics":["applescript","automation","macos","swift"],"latest_commit_sha":null,"homepage":"https://hhas.bitbucket.io/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hhas.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T10:59:51.000Z","updated_at":"2025-04-01T10:39:03.000Z","dependencies_parsed_at":"2023-02-10T03:01:27.979Z","dependency_job_id":null,"html_url":"https://github.com/hhas/SwiftAutomation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhas%2FSwiftAutomation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhas%2FSwiftAutomation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhas%2FSwiftAutomation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhas%2FSwiftAutomation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hhas","download_url":"https://codeload.github.com/hhas/SwiftAutomation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456381,"owners_count":21106607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","automation","macos","swift"],"created_at":"2025-03-25T14:19:22.346Z","updated_at":"2025-04-11T18:24:15.594Z","avatar_url":"https://github.com/hhas.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftAutomation README\n\n## About\n\nSwiftAutomation is an Apple event bridge that allows Apple's Swift language \nto control \"AppleScriptable\" macOS applications directly. For example:\n\n  // tell application \"iTunes\" to play\n  try ITunes().play()\n\n  // tell application \"Finder\" to set fileNames to name of every file of home\n  let fileNames = try Finder().home.files.name.get() as [String]\n\n\n  // tell application \"TextEdit\" to make new document ¬\n  //                                     with properties {text:\"Hello World!\"}\n  try TextEdit().make(new: TED.document, \n                      withProperties: [TED.text: \"Hello World!\"])\n\n\nThe SwiftAutomation framework defines the basic functionality for constructing\nobject specifiers, converting data between Swift and AE types, and sending \nApple events to running applications. Generated Swift files supply the glue\ncode for controlling individual applications using human-readable terminology.\n\n\n## Get it\n\nTo clone the Xcode project to your own machine:\n\n  git clone https://github.com/hhas/SwiftAutomation.git\n\nA basic Swift \"script editor\" (currently under development) is also available:\n\n  https://github.com/hhas/swiftautoedit\n\n\n## Install it\n\nTo embed SwiftAutomation for use in Swift-based GUI apps see Xcode's Workspace\ndocumentation.\n\nTo use SwiftAutomation in Swift \"scripting\", see the Installing SwiftAutomation\nchapter of the SwiftAutomation documentation. Until Swift provides a stable ABI\nsome manual set-up is required.\n\n\n## Try it\n\nTo run simple examples (see test/main.swift), build and run the `test` target.\n\nAdditional glues can be generated by building the `aeglue` target and running\nthe resulting `aeglue` command line tool in Terminal. For example, to generate\na Swift glue and accompanying documentation for macOS's Photos application:\n\n  /path/to/aeglue -o ~/Desktop Photos\n\nNote that `aeglue` normally retrieves application terminology using `ascrgdte`\n('get dynamic terminology') Apple events. Some applications (e.g. Finder) have\nfaulty `ascrgdte` handlers that fail to return correct terminology, in which\ncase use the `-s` or 'Use SDEF terminology' options instead. (Be aware that\nSDEF-based terminology may also contain bugs and omissions, in which case use\nraw four-char codes or correct generated glue code by hand.)\n\nSwiftAutomation requires macOS 10.11 and Swift 3.0 and Xcode 8.0 or later.\n\n\n## Status\n\nThe code is complete except for testing and bug fixes. The documentation lacks\na usable tutorial chapter. Given current uncertainty regarding the future of\nApple event-based automation the project is on hiatus until WWDC17, after which\na final decision on its future can be made.\n\n\n## Known issues\n\nWhen using SwiftAutomation within an interactive playground, be aware that Xcode\nautomatically re-runs ALL code within a playground whenever a line of code is\nmodified, causing ALL application commands to be re-sent. This is not a problem\nwhen using non-mutating application commands such as `get` and `count`; however,\ntake care when using commands that modify the application's state - `make`,\n`move`, `delete`, etc. - within a playground as sending these more than once may\nhave unintended/undesirable results. This is a playground issue that affects ALL\nnon-idempotent and/or unsafe function calls, not just application commands.\n\n\n## Etc.\n\nSwiftAutomation is released into the public domain.\n\nNo warranty given, E\u0026OE, use at own risk, etc.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhas%2Fswiftautomation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhhas%2Fswiftautomation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhas%2Fswiftautomation/lists"}