{"id":13582189,"url":"https://github.com/andybrewer/mack","last_synced_at":"2025-04-05T03:10:55.536Z","repository":{"id":27281043,"uuid":"30754378","full_name":"andybrewer/mack","owner":"andybrewer","description":"Mack — Golang wrapper for AppleScript","archived":false,"fork":false,"pushed_at":"2023-10-08T03:25:57.000Z","size":27,"stargazers_count":341,"open_issues_count":4,"forks_count":27,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T02:06:43.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andybrewer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-02-13T11:53:42.000Z","updated_at":"2025-03-27T23:56:33.000Z","dependencies_parsed_at":"2022-07-25T17:22:17.243Z","dependency_job_id":"1ce82a40-ecba-4ba0-ae44-c600c6db87af","html_url":"https://github.com/andybrewer/mack","commit_stats":null,"previous_names":["everdev/mack"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrewer%2Fmack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrewer%2Fmack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrewer%2Fmack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybrewer%2Fmack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andybrewer","download_url":"https://codeload.github.com/andybrewer/mack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":[],"created_at":"2024-08-01T15:02:28.967Z","updated_at":"2025-04-05T03:10:55.514Z","avatar_url":"https://github.com/andybrewer.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Mack\nMack is a Golang wrapper for AppleScript. With Mack, you can easily trigger OS X desktop notifications and system sounds from within your Go application.\n\n## Installation\nMack requires OS X.\n\n`go get github.com/andybrewer/mack`\n\n## Usage\nMack is ideal for local workflow optimization, OS X binary applications, or just spicing things up. For example:\n\n### Workflow: Process notification\nWhen executing a long-running process, trigger a notification so you can get back to development without having to check the execution status.\n```go\npackage main\n\nimport \"github.com/andybrewer/mack\"\n\nfunc main() {\n  mack.Say(\"Starting process\")\n  // do stuff\n  mack.Notify(\"Complete\")\n}\n```\n\n### Workflow: Open applications\nInteract with any Mac application from your code, like opening a URL to a HowTo video.\n```go\npackage main\n\nimport (\n  \"github.com/andybrewer/mack\"\n)\n\nfunc main() {\n  browsers := []string{\"Some new browser\", \"Google Chrome\", \"Firefox\", \"Safari\"}\n  opened := false\n\n  for _, browser := range browsers {\n    _, err := mack.Tell(browser, `open location \"http://youtube.com/my-howto-video\"`)\n    if err != nil {\n      // handle error\n    } else {\n      // exit when we found a browser that works\n      opened = true\n      break\n    }\n  }\n\n  if !opened {\n    // alert user that a common browser could not be found\n  }\n}\n```\n\n### App: ToDo list\nAdd a cheap GUI to your applications\n```go\npackage main\n\nimport \"github.com/andybrewer/mack\"\n\nfunc main() {\n  response, err := mack.Dialog(\"Enter a ToDo\", \"ToDo Wizard\", \"My new ToDo\")\n  if err != nil {\n    panic(err)\n  }\n\n  if response.Clicked == \"Cancel\" {\n    // handle the Cancel event\n  } else {\n    newToDo := response.Text\n    // add ToDo to the database\n    mack.Notify(\"Added \" + newToDo + \" to your calendar\")\n  }\n}\n```\n\n### Workflow: clipboard\nManipulate the clipboard\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/andybrewer/mack\"\n)\n\nfunc main() {\n  // Output the content of the clipboard\n  content, _ := mack.Clipboard()\n  fmt.Println(content)\n\n  // Change the content of the clipboard\n  mack.SetClipboard(\"Hello World!\")\n  content, _ = mack.Clipboard()\n  fmt.Println(content)\n}\n```\n\n## Documentation\nCurrently, Mack supports the following AppleScript commands:\n* Beep\n* Clipboard\n* Display Alert\n* Display Dialog\n* Display Notification\n* Say\n* Tell\n\nFull documentation is available at: [godoc.org/github.com/andybrewer/mack](http://godoc.org/github.com/andybrewer/mack)\n\n## Links\n* [AppleScript Command Reference Docs](https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html)\n\n## Contributors\n* Andy Brewer ([andybrewer](https://github.com/andybrewer))\n* Hiroaki Nakamura ([hnakamur](https://github.com/hnakamur))\n* Antoine Augusti ([AntoineAugusti](https://github.com/AntoineAugusti))\n* Gareth Watts ([gwatts](https://github.com/gwatts))\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybrewer%2Fmack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandybrewer%2Fmack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybrewer%2Fmack/lists"}