https://github.com/miyako/4d-plugin-prevent-app-nap
Prevent App Nap
https://github.com/miyako/4d-plugin-prevent-app-nap
4d-plugin
Last synced: 11 months ago
JSON representation
Prevent App Nap
- Host: GitHub
- URL: https://github.com/miyako/4d-plugin-prevent-app-nap
- Owner: miyako
- License: mit
- Created: 2018-11-19T09:12:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-01T00:48:42.000Z (over 4 years ago)
- Last Synced: 2025-01-08T17:57:03.534Z (over 1 year ago)
- Topics: 4d-plugin
- Language: C
- Homepage:
- Size: 1.65 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](LICENSE)

# 4d-plugin-prevent-app-nap
Prevent App Nap using [beginActivityWithOptions:reason:](https://developer.apple.com/documentation/foundation/nsprocessinfo/1415995-beginactivitywithoptions)
## Syntax
```
BEGIN IMPORTANT ACTIVITY (options;reason)
END IMPORTANT ACTIVITY
```
Parameter|Type|Description
------------|------------|----
options|LONGINT|combination of ``Prevent system sleep`` ``Prevent automatic termination`` ``Prevent display sleep`` ``Prevent sudden termination``
reason|TEXT|
**Note**: ``END IMPORTANT ACTIVITY`` is automatically called when you close your application
## Examples
```
BEGIN IMPORTANT ACTIVITY (\
Prevent system sleep;\
"4D is super busy!!!")
TRACE
END IMPORTANT ACTIVITY
```
4D will appear as "preventing sleep" in Activity Monitor