I'm Sorry :)

Oh the snap thing that brings all the windows into view sort of thing? Thats a mimic of expose (think thats the right bit of osx) if you have the multi finger track pad 4 fingers stoke down brings it up or the button on the function key line that looks like 3 small boxes in a bigger 4th (on my mac its F3 but they have habits of moving it)
 
Can i also say sorry....


...to all tho people that still have to use Windows.....truly and deeply...I feel sorry...for you all.

Don't worry about us, we're fine.

I think by snap he means dragging a window to the edge of the screen and changing the window size, rather than expose (4 finger swipe rules btw). The strange OSX "+" button will adjust the screen depending on the content - that's about as close as you get without some third party software.
 
So to repeat my earlier question - any way of mapping drives? [Sorry cu3ed, OS X sucks at that! :p]

My Finder crashes and I have to reboot if my MBP goes to sleep with network shares mounted. :(
 
I will give it a go myself shortly :)

On the whole I am very impressed, just all these small issues kinda makes me go "grrr". It just works. Yeah, right! :p
 
Bah! Bloody OS X! :mad:

The tip above is for NFS shares only. So I thought "I know, I will just create NFS shares on my server!"

5 hours later I finally get NFS and Unix attributes sorted on my SBS2008 server. NFS shares load fine through the Finder's Connect To menu. However, I could not get them to automount via the Disk Utility. No idea why but I gave up on it.

Instead I used a combination of SleepWatcher and some applescripts :) I can now mount my SMB shares at login, and they are also unmounted when my MBP goes to sleep and mounted when it wakes up! :D

No more annoying errors. Yippee!

I fail to see why Apple hasn't included basic stuff like this in its OS.
 
Bah! Bloody OS X! :mad:

The tip above is for NFS shares only. So I thought "I know, I will just create NFS shares on my server!"

5 hours later I finally get NFS and Unix attributes sorted on my SBS2008 server. NFS shares load fine through the Finder's Connect To menu. However, I could not get them to automount via the Disk Utility. No idea why but I gave up on it.

Instead I used a combination of SleepWatcher and some applescripts :) I can now mount my SMB shares at login, and they are also unmounted when my MBP goes to sleep and mounted when it wakes up! :D

No more annoying errors. Yippee!

I fail to see why Apple hasn't included basic stuff like this in its OS.

Can you post your scripts and a guide?

I may use my Samba shares if it's easier.
 
Download SleepWatcher 2.1 and unzip it to wherever.

In the unzipped folder is a README. Scroll down to the Installation for new SleepWatcher users section for instructions on installation. As it says, there are two plist files in the config folder. You want to copy the *-user.plist version to ~/Library/LaunchAgent

Now, in your home folder you need to create three scripts - .sleep, .wakup and wake

.sleep Script
Code:
#!/bin/sh
/usr/bin/osascript -e "tell application \"Finder\"" -e "eject \"Media\"" -e "end tell"
NB: osascript is the AppleScript interpreter, and the -e paramater is a separate line. So above we are building a 3 line applescript on the fly.

.wakeup Script
Code:
#!/bin/bash
/usr/bin/osascript ~/Scripts/wake.app
wake Script
Code:
on run 
    repeat 5 times
        try 
            do shell script "curl http://windward" 
            mount volume "smb://windward/Media" 
            exit

            on error 
               -- continue 
        end try 
        delay 2 
     end repeat 
end run
With .wakeup I split it into two parts. The .wakeup script and a wake.app script. I could have built the wake.app script on the fly again, but since it was a larger script I opted not to.

Now basically this is how it works:

When SleepWatcher detects your MBP is going to sleep, it runs the .sleep script. That uses AppleScript to tell Finder to eject the Media drive. You can copy/paste the same line [altering the name of the drive to eject] for as many times as you need.

When your MBP wakes up again, SleepWatcher runs the .wakeup script. The .wakeup script calls the AppleScript wake.app. wake.app first of all checks if my MBP is connected to the network by contacting my server. You can substitute this address with your own intranet site or just do something like www.google.com - I do this because sometimes the mount would fail as the script would run before the WiFi reconnected. It will keep checking for a connection before finally mounting a drive using Finder. The wake.app script as is will try to connect 5 times and then give up. You can change this by changing the line "repeat 5 times" to any number that suits you.

I could have used a straight forward mount/umount, but going via the Finder means I don't need to use any usernames or passwords in my scripts - it automatically uses the OS X keychain! Handy eh? And a little more secure :)

You will need to create wake.app yourself from the wake script. This is really easy - open wake with the AppleScript Editor [Applications > Utilities] and save it as an application. I saved it to ~/Scripts. Where you save it to is your choice - just remember to change the path in .wake

So far I have no issues with this which I am happy about. I also reuse the wake.app as one of my Login Items. That way I can manage how and what gets mounted from the app, and not mess about editing the Login Items list.

If you have problems just let me know :)

EDIT: I should point out the wake.app script is an infinite loop - this works fine for me since I will rarely, if ever, be taking my MBP out anywhere any time soon. But when I get chance I will change it so it will give up after a certain number of tries - this way it's not chewing up resources if you happen to be away from home.

EDIT EDIT: OK I have already tweaked it - was much easier than I thought. I have changed the wake script accordingly :)
 
Last edited:
If you were using AFP shares you would not have the problem you have found. I have AFP share on my ubuntu server and it is mounted with the start up, and then will be kept be remounted even after sleep.
 
Back
Top Bottom