{"id":18964715,"url":"https://github.com/clipy/screeen","last_synced_at":"2025-07-25T15:03:33.292Z","repository":{"id":9687601,"uuid":"63000167","full_name":"Clipy/Screeen","owner":"Clipy","description":"Observe user screen shot event in macOS.","archived":false,"fork":false,"pushed_at":"2024-05-16T21:48:03.000Z","size":166,"stargazers_count":59,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T12:09:07.040Z","etag":null,"topics":["clipy","macos","sandbox","screenshot","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Clipy.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-10T13:34:45.000Z","updated_at":"2024-12-14T00:08:52.000Z","dependencies_parsed_at":"2024-06-21T14:08:01.359Z","dependency_job_id":"078fe929-2265-41a0-bc0f-077675d8e111","html_url":"https://github.com/Clipy/Screeen","commit_stats":{"total_commits":48,"total_committers":4,"mean_commits":12.0,"dds":"0.41666666666666663","last_synced_commit":"357a72be0060765a8e93b9a70b283fc63c75f4a9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clipy%2FScreeen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clipy%2FScreeen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clipy%2FScreeen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clipy%2FScreeen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clipy","download_url":"https://codeload.github.com/Clipy/Screeen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710448,"owners_count":21149190,"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":["clipy","macos","sandbox","screenshot","swift"],"created_at":"2024-11-08T14:25:44.846Z","updated_at":"2025-04-13T12:09:17.944Z","avatar_url":"https://github.com/Clipy.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Screeen\n[![Actions Status](https://github.com/Clipy/Screeen/workflows/Xcode-Build/badge.svg)](https://github.com/Clipy/Screeen/actions)\n[![Release version](https://img.shields.io/github/release/Clipy/Screeen.svg)](https://github.com/Clipy/Screeen/releases/latest)\n[![License: MIT](https://img.shields.io/github/license/Clipy/Screeen.svg)](https://github.com/Clipy/Screeen/blob/master/LICENSE)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Version](https://img.shields.io/cocoapods/v/Screeen.svg)](http://cocoadocs.org/docsets/Screeen)\n[![Platform](https://img.shields.io/cocoapods/p/Screeen.svg)](http://cocoadocs.org/docsets/Screeen)\n[![SPM supported](https://img.shields.io/badge/SPM-supported-DE5C43.svg?style=flat)](https://swift.org/package-manager)\n\nObserve user screen shot event and image in macOS.\n\n## Usage\n### CocoaPods\n```\npod 'Screeen'\n```\n\n### Carthage\n```\ngithub \"Clipy/Screeen\"\n```\n\n## Example\n```swift\nlet observer = ScreenShotObserver()\nobserver.delegate = self\nobserver.start()\n```\n\n```swift\nfunc screenShotObserver(_ observer: ScreenShotObserver, addedItem item: NSMetadataItem) {\n    print(\"added item == \\(item)\")\n}\n\nfunc screenShotObserver(_ observer: ScreenShotObserver, updatedItem item: NSMetadataItem) {\n    print(\"updated item == \\(item)\")\n}\n\nfunc screenShotObserver(_ observer: ScreenShotObserver, removedItem item: NSMetadataItem) {\n    print(\"removed item == \\(item)\")\n}\n```\n\nChange observing status\n```swift\nobserver.isEnabled = false // Stop observing\nobserver.isEnabled = true  // Restart observing\n```\n\n## Security features of macOS 10.15 or higher\nSecurity features have been enhanced since mac10.15 Catalina, and screenshot monitoring must be granted permission. The monitoring target can be specified for each directory, and the desktop directory is specified by default.　\n\nWhen call `start()` for the first time, a permission alert will be displayed and monitoring will start when allow it.\n\n### Desktop directory monitoring (default)\n```\nlet observer = ScreenShotObserver()\nobserver.start()\n```\n\n### Desktop and Picture directories monitoring\n```\nlet desktopPath = NSSearchPathForDirectoriesInDomains(.desktopDirectory, .userDomainMask, true).first\nlet picturePath = NSSearchPathForDirectoriesInDomains(.picturesDirectory, .userDomainMask, true).first\nlet directoryPaths = [desktopPath, picturePath].compactMap { $0 }\nlet observer = ScreenShotObserver(searchDirectoryPaths: directoryPaths)\nobserver.start()\n```\n\n### Monitoring all screenshots on macOS 10.14 or earlier\n```\nlet observer: ScreenShotObserver\nif #available(macOS 10.15, *) {\n    observer = ScreenShotObserver()\n} else {\n    observer = ScreenShotObserver(searchDirectoryPaths: [])\n}\nobserver.start()\n```\n\n## Sandbox support\nIn order to monitor screen shots in a Sandbox enabled application, the user must manually select the directory to be monitored.  \n[See here](./Documentation/SANDBOX.md) for more details on how to implement it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclipy%2Fscreeen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclipy%2Fscreeen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclipy%2Fscreeen/lists"}