Preventing a stay-open applet from "App Nap"

Happy New Year 2016

My concern deals with “App Nap” which prevents an applet to work steadily.
This applet checks and records regularly in the background a DSL modem performances, using an “idle loop”.

For a long time we couldn’t figure out why it was precise as a metronome from 10.6 to 10.8 and displayed irregular time jumps of several seconds with Mavericks and above. Now we understand that the culprit is “App nap” putting the applet to sleep while it’s waiting idle for the next checking’s time.

Weird things to know : If we save the original script into an applet stay-open with Lion 10.7.5, the applet will show the check-box “prevent App Nap” in its get-info window. And it works: the “App Nap” is dismissed.
If we save the applet from El Capitan, no more checkbox to block the App Nap !

We tried to insert manually into its info.plist file the flag
NSAppSleepDisabled
¨
but to no avail.

Is there a scripting trick to make my app prevented from “App nap”?
For example can we put at the beginning of the script a property giving the same effect as the line above, or a shell script performing
“NSAppSleepDisabled -bool Yes”
for my app only, not for the whole NSGlobalDomain?

Thank you for your help.

Get your app’s bundle identifier (ID property) and run this in Terminal:

defaults write NSAppSleepDisabled -bool YES

Good morning Shane,

Thank you it runs fine now, embedded in a /do shell script/
:slight_smile: