10.5: Eject drives and run iSync before sleep via script

This is a little AppleScript that I wrote to check and ask if the machine should unmount peripheral disks, and optionally perform an iSync, before sleeping. I was motivated to write this after about the fifteenth time I woke my laptop up after taking it home from work only to be greeted with a warning that I did not properly disconnect my Time Machine Disk. Additionally, since I use iSync to sync my date book and address book with my Nokia cell phone, I thought it would be a good idea to have it auto-sync before I put the machine to sleep. If you are capable with AppleScript, you can go in and make modifications for your system (e.g. turn off iSync, or the options to unmount). One caveat: if your home disk is not the same as the startup disk (unlikely on a laptop), the script will ask if you would like to unmount that disk before sleeping.I packed the script as an application bundle (with a 10.5-sized icon) for optional placement directly into the dock -- download ...

published on Friday, the 25. April 2008, macosxhints

10.4: Possible security issue with wake from sleep

I like my PowerBook to be secure, so in the Security System Preferences panel, I require a password when coming back from sleep. I noticed a little problem though: assume I wake the machine, and after entering my password (but before the desktop is loaded), I close the lid, and the PowerBook goes to sleep. When I wake up the PowerBook the next time, it doesn't ask for a password, but shows my secrets to the world.So don't close the lid and believe you're safe, unless you are very sure you are fully logged in. Especially when you move around a lot, and are used to just closing the notebook and stuffing it in you bag.[robg adds: This hint was marked 10.4 only; I couldn't replicate it on 10.5, at least on my desktop machine.]

published on Wednesday, the 23. January 2008, macosxhints

10.5: A python script to work around a sleep issue

After installing Leopard, my iMac would no longer auto sleep. It worked flawlessly in Tiger. I searched google and found many others having similar problems. I found many different fixes, such as removing the PowerManagement plist file, unplugging all devices, and not running certain widgets or programs. However, no matter what I did, it would not auto sleep. It would stay asleep if I manually put it to sleep. I called Apple and was on the phone with them for about two hours before they said it is probably a hardware problem, thanks for calling. After all that hassle, I decided to see if AppleScript could put it to sleep, and it did. Once I found that out, I just wrote a python program that keeps track of how long the screen saver is running. Using that, it determines if the system has been unused for the period the user set in system preferences for machine sleep. ...

published on Sunday, the 23. December 2007, macosxhints

Avoid Logitech Control Center crashes via a reminder

I love my Logitech MX510 multi-button mouse, but it has a drawback: to use all the nifty buttons on it, you have to use the Logitech Control Center (or pony up for USB Overdrive). While the most recent version (2.4.0 as of this writing) of LCC no longer uses the controversial Unsanity APE, it's not bug-free. In particular, if I unplug my mouse after putting my Mac to sleep, the system won't wake up -- a power-button reset is my only option. The obvious cure is to unplug before sleep, but I have a habit of doing things in the opposite order. The following AppleScript reminds me to do first things first: display dialog "Remove mouse before sleep" with icon caution tell application "Finder" to sleep I use Butler to trigger this with a hotkey, but any technique to launch an AppleScript will...

published on Thursday, the 20. December 2007, macosxhints

10.5: A useless hint to create infinitely mirrored screens

First, this is just for fun, and has no practical use at all. Second, see the warning below before trying this... Everyone knows the old fairground trick of infinite mirrors, where opposing mirrors give an image repeating itself into infinity. This was also replicated famously in Queen's Bohemian Rhapsody video. Well, try this...from Mac #1, connect to Mac #2 using screen sharing in the Finder (not iChat). From within the screen sharing window, connect Mac #2 to Mac #1, again using screen sharing. Stand back and wonder what you can use this for! Warning: I had trouble getting out of this mode once in it. To do so, I put Mac #1 into sleep mode (press and hold the power button), and as soon as I woke it again, was able to quit screen sharing. YVMV, and I have no idea what effect different window sizings or options may have. Fun for the child within though :...

published on Tuesday, the 4. December 2007, macosxhints

Quickly reach the home page from a locked iPhone

I'm not sure how long this has been around; I'm expecting since 1.1.2 released. If your iPhone locks (sleeps) when it's inside of any application, you can quickly return to the home screen without extra button pushes: Lock your phone while in an app, like the iPod. Press the Home button to wake it. Immediately swipe to unlock. Speed is key; usually the swipe has to be started before the screen lights up. When the iPhone unlocks, the iPhone returns to Home screen instead of the iPod. (Some apps seem to be tougher to do this with than others.) This doesn't happen when the phone is awakened with the Lock button, and it's clear that the application isn't crashing, because you can occasionally grab glimpses of the retreating application's animation and the Home screen's animation. A quick poll of my two iPhone-owning coworkers think it's a bug, but it's a slightly useful one.

published on Thursday, the 29. November 2007, macosxhints

10.5: Charge iPods and iPhones while sleeping

I noticed that after installing 10.5, my iPod and iPhone both charge when the computer is asleep. I have tested this on a few machines now, and none of them that had Tiger would do this, including my machine before I installed 10.5.[robg adds: In some limited testing on my machines, this definitely seems to work -- and is a great reason to upgrade to 10.5, all by itself. I lamented the loss of charge-while-sleeping when the FireWire - USB switch was made, but now, it seems we have it back!]

published on Friday, the 9. November 2007, macosxhints

Wireless mouse dead? Use Universal Access

I have a wireless Apple bluetooth mouse on my iMac. I have periodically lost access to the mouse for various reasons, such as when the batteries die. (This happens too often, since I usually use my laptop and the desktop sits and sleeps for long periods. Turning the mouse off manually is a pain as I have to let it pair before doing anything). I usually have a wired mouse connected or nearby for such cases, but I found a neater and quicker solution in the Universal Access preference pane in the System Preferences. Under the Mouse or Mouse and Trackpad tab, the first item listed is "Mouse Keys". This needs to be turned on of course, but I prefer not to have this enabled all the time.The trick here is to check the next box, "Press the option key five times to turn Mouse keys on or off".With this enabled, the next time you lose mouse connectivity, you just have to press the option key five times to enable the mouse keys, then control the cursor using your number-key pad....

published on Tuesday, the 29. May 2007, macosxhints

Ease the VPN connect/disconnect process

If you're like me, you often find yourself connecting to VPN networks. Every time I open my laptop, I must log on to the VPN in order to access the Internet. Not that this is a tedious task, but it is annoying. So I thought I'd write an AppleScript to automate the task. Right before I attempted to write the script (which would connect if and only if a specific wifi network is joined), I came across this free little application called PearportVPN (it's the third entry on that page).It does all the work for you, and even disconnects from the VPN before putting your Mac to sleep. That feature is great -- otherwise you would receive a time-out message if you forget to disconnect from your VPN. Here's a screenshot of the pearPortVPN interface, in case you're curious as to what it looks like. I have no affiliation with pear, but thought others might f...

published on Friday, the 11. May 2007, macosxhints

Shift display dimming settings with time of day

I have a Mac mini in the bedroom which we use for watching movies and controlling the music throughout the apartment. During the day, I want it to show a screensaver (a Flickr slideshow using ShuffleSaver) for a while before blanking the screen. But at night, I want it to go dark quickly so it doesn't keep us up. I put this in root's crontab to do it automatically: 0 6 * * * /usr/bin/pmset displaysleep 20 0 20 * * * /usr/bin/pmset displaysleep 1 [robg adds: The easiest way to set root's crontab, if you're not an experienced command line user, is to use Cronnix. We have two other hints dealing with changing the display sleep times.]

published on Thursday, the 12. April 2007, macosxhints