« MBS Xojo / Real Studi… | Home | Xojo Developer Meetin… »

Disable App Nap, System and Screen Sleep in FileMaker

If you like to disable FileMaker from sleeping while doing a long operation, e.g. a script to export or import, you can use plugin functions.

We got a couple of ProcessActivity functions. To start an activity you call ProcessActivity.beginActivity with the parameters describing the activity. First you provide the options, e.g. IdleDisplaySleepDisabled or IdleSystemSleepDisabled. This can be combined with an attribute like UserInitiated or Background to tell system if it is important to keep awake (user initiated) or not so important (background activity). The second parameter is a reason which may be showed by the system somewhere.

This function returns a reference number for the activity which can be used to query details or to end activity. To end you call ProcessActivity.endActivity providing the reference number of the activity. Using those numbers we can have several activities running at a time.

Those activity APIs are the recommended way from Apple to keep the system from idle sleep or your app to be put on app nap. While you can also exclude applications from App Nap with a flag in the Finder's info dialog (not possible for FileMaker 14), it's highly recommended to let the app take a nap to save battery power.

Available in 5.1pr2 later this week. Please email us if you need a copy today.

PS: Similar things can be done in Xojo with NSProcessInfoMBS class.
03 06 15 - 14:50
No comments

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.