Jump to content

Autosleep-Script


KWS
 Share

165 posts in this topic

Recommended Posts

My solution came from the "far" other end. I work as a designer (unfortunately more dtp) and am familiar with Applescripts to shorten production processes.

But a additional problem is to prevent sleep during various circumstances (Network-activity, Quicktime, VLC) , so maybe it is possible to resolve that with a cpu-load query in combination with some in my script used shellscripts ... ?

 

 

 

 

PleazeSleep.app

Link to comment
Share on other sites

awesome app! Thank you a lot for sharing it... I was on Gigabyte DS3 with ok sleep but not auto.sleep... Now it works!!!! You saved me a lot because my media center was running all day.

 

I also would like to add some programs, for example Plex playing, or Movist playing... I mean not only opened apps (like resistant, that works perfect), I would like to check if is also playing like you did with Itunes, Dvd Player, Quickmovie, etc. Please can you point me where can I find some parameters? I tried with activiy monitor but I can't see anything

 

Thank you a lot :cold:

Link to comment
Share on other sites

I tried pleasesleep.app and same issue is that if you're not logged in, it's not running. KWS's script worked great for me, only I don't set auto-login. We have multiple users sharing a hack/mac, so half the time I want the system to sleep is when no one is logged in. KWS sent me a cool Bourne shell script that actually seems to work querying network traffic. It only takes a second to run. I'm adding that to the sleepcheck.sh and seeing if we can script a completely independent query that can run in cron outside of a GUI login context.

Link to comment
Share on other sites

  • 3 weeks later...

Hi I have this ASUS DVD Drive from Newegg. Sleep and waking from sleep, restart, shutdown all work well on my system.

 

However my system does not autosleep. This DVD drive is not supported for autosleep.

 

I read through this thread and looked at a lot different items to place the computer to sleep. Can someone please tell me which work the best for the issue where the computer does not sleep due to DVD drive issues. Thanks.

Link to comment
Share on other sites

  • 4 weeks later...

Ive been really bugged by my mbp not going to sleep by itself EVER in the 4 years Ive owned it, especially since I put a 7200rmp HDD in it, now its very loud vibrating and being amplified thru my desk at night.

 

Ive looked and tried a whole bunch of things to get it to sleep automatically and none worked until now.

 

You have no idea how grateful I am

 

Thank you thank you thank you :D

 

 

I was wondering if this script could be modified to power down the HDD while using the machine also?

 

the other day my laptop went to sleep while watching eytv and I lost what I was caching to watch a bit later, is there a way to adjust the overall cpu load threshold before sleep rather than individual app thresholds?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

I tried out the script last night and it may be a coincidence, but my computer seems seriously hosed. I left it running and my computer was asleep this morning as expected. When I tried to wake it up, it did wake up momentarily, but then went right back to sleep (blinking power light, but fans still on). When I attempted a restart, Lion will not boot even with various flags. Single user boot seems to fail at the point of it trying to fsck the drive. Running disk first aid from my install usb stick turns up no errors, but does say it updates the boot driver. The strangeness is that even separate snow leopard installs (2 installs, 2 separate drives, each install has it's own chameleon on EFI partitions) are suddenly no longer booting as well. I'm currently booted into a windows vista partition and I can access files on the hfs drives, so that is good at least. ;)

 

If anyone has any idea on what could have gone wrong to cause this, I would be very happy to hear your thoughts. Could the crash have affected the boot partitions on all the drives? I'm at a bit of a loss.

Link to comment
Share on other sites

I tried out the script last night and it may be a coincidence, but my computer seems seriously hosed. I left it running and my computer was asleep this morning as expected. When I tried to wake it up, it did wake up momentarily, but then went right back to sleep (blinking power light, but fans still on). When I attempted a restart, Lion will not boot even with various flags. Single user boot seems to fail at the point of it trying to fsck the drive. Running disk first aid from my install usb stick turns up no errors, but does say it updates the boot driver. The strangeness is that even separate snow leopard installs (2 installs, 2 separate drives, each install has it's own chameleon on EFI partitions) are suddenly no longer booting as well. I'm currently booted into a windows vista partition and I can access files on the hfs drives, so that is good at least. :(

 

If anyone has any idea on what could have gone wrong to cause this, I would be very happy to hear your thoughts. Could the crash have affected the boot partitions on all the drives? I'm at a bit of a loss.

you might had cmos reset, so ahci changed back to ide, check if this is the case

Link to comment
Share on other sites

you might had cmos reset, so ahci changed back to ide, check if this is the case

 

Oh wow. Thanks so much for taking the time to think about it and reply.

 

I had checked that I was on ahci (I had to change it from that to ide when I booted vista), but that explanation makes so much sense and sure enough when I toggled it back to ahci, I seem to be booting fine.

 

And I was getting ready to install a fresh hard drive, install lion again and see if I could fix the boot partition manually.. haha..

 

Thanks again for posting :(

Link to comment
Share on other sites

Works perfect on Asus p6tdeluxe ver.1, on Lion OS X, because the patched AppleHDA.kext sends every 10sec sound assertetion error and breaking the iddle sleep, the Autosleep script just work perfect.

Notice, when downloading with safari or speed download, or with whatever, You must use the Downloads folder, not any other folder on the HDD or at any other HDD, it will break Your download in the middle(according to sleep time set in system preferences)

Again, nice work and Idea

You should keep on upgrading the script with some new stuffs(if any news are needed).

Link to comment
Share on other sites

Thank's so much for this script- works perfectly! Only issue I am having is that whenever Adobe Flash is open, the computer doesn't sleep. This is not under the "Safari" program (added "Safari:100" for kicks and didn't help) but I can't add Flash Player to the main.scpt with Open RIP 10.7. Can someone help me edit the script to include Flash Player? Much appreciated!

Link to comment
Share on other sites

  • 2 weeks later...

KWS

Couple days ago I was using the super duper to backup my Lion osx, and before that I was copying some large files between the partitions, in both ways the script triggered the auto sleep (but in this cases it shouldn't).Isn't the script monitoring the master CPU load or?

Pls tell me how the script is programmed , this line : set CPUload to {"Finder:2"} --CPUload, it is supposed to monitor the general CPU load and above 30% from 0.2%(that is 0.26% cpu load) the script should prevent the auto sleep.

Pls tell me how can I add some application, for example super duper or whatever, How can I tell the script to monitor the finder or cpu load and above 2% of general use(not 0.2) not to trigger.

And does the script usese the original autosleep timer from system preferences?

Pls , tell me how can i implement in this script the situation when the files are copied from one to onother partition in the OSX , how to insert the line to monitor the Finder activity and above 2% use - not to trigger the auto sleep

Also isnt possible to add ability , the network traffic to be watch generally ant not only for the "downloads" folder, for example on some other partition - Im willing to insert those lines by myself, but i need your assistence in the begging.

 

thanks

Link to comment
Share on other sites

KWS

Couple days ago I was using the super duper to backup my Lion osx, and before that I was copying some large files between the partitions, in both ways the script triggered the auto sleep (but in this cases it shouldn't).Isn't the script monitoring the master CPU load or?

Pls tell me how the script is programmed , this line : set CPUload to {"Finder:2"} --CPUload, it is supposed to monitor the general CPU load and above 30% from 0.2%(that is 0.26% cpu load) the script should prevent the auto sleep.

Pls tell me how can I add some application, for example super duper or whatever, How can I tell the script to monitor the finder or cpu load and above 2% of general use(not 0.2) not to trigger.

And does the script usese the original autosleep timer from system preferences?

Pls , tell me how can i implement in this script the situation when the files are copied from one to onother partition in the OSX , how to insert the line to monitor the Finder activity and above 2% use - not to trigger the auto sleep

Also isnt possible to add ability , the network traffic to be watch generally ant not only for the "downloads" folder, for example on some other partition - Im willing to insert those lines by myself, but i need your assistence in the begging.

 

thanks

 

Use Open RIP 10.7 (attached). If you have any questions then ask but I believe you just open this and it will find the script, and follow instructions in window to edit.

Open_RIP_10.7.app.zip

Link to comment
Share on other sites

Use Open RIP 10.7 (attached). If you have any questions then ask but I believe you just open this and it will find the script, and follow instructions in window to edit.

I answered already via PM ...

Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...