 Sometimes the trash won't be emptied, or a volume refuses to eject with a "file in use error." There have been hints on how to find that out in Terminal with lsof, which is not necessarily for the faint of heart.
Here is a nice Automator workflow that runs some AppleScript and shell commands and can be used in contextual Finder menu. So when a file is reported used, control-click on it and run the Automator workflow and see who is to blame. It will use user process space (no prompt for admin password), but will also revert to system process space if needed (prompting for the password). It will display the application/process that is using the file, and the account that started the program (could be you, could be root, could be another local user).
[808 views]
 I was looking for a quick way to rotate only the even numbered pages in a document that I had scanned in using my Brother MFC's scan-to-email feature in duplex mode -- I found that it had flipped every second page, and they needed to be unflipped. It turns out there's a not-so-obvious way to do this rather easily.
Make sure the sidebar is showing on the side of the document you want to work on in dual column mode (Control-click in the Thumbnail column and select Columns » 2 Columns), and you will see that all the even pages line up in one column. You can then drag a square around the entire column, and keep going down until you've highlighted all the pages you want to rotate.
Next, press Command-R twice to flip the selected pages upside down, or once to rotate them to landscape mode (90 degrees). This works pretty much as it does on a single page. There is a also a menu command to rotate pages if you don't like using keyboard shortcuts.
[396 views]
I use FileVault to encrypt the contents of my home folder. In the case of my laptop being stolen or lost, the new user should therefore be unable (or find it extremely hard at least) to access my work and personal confidential data.
FileVault is very powerful, but it has a downside: FileVault loses some of my file associations and related preferences each time I log out, restart, or shutdown. For example, my preferred browser is Firefox, not Safari. Therefore, every time I log in, I have to reset the Firefox to be my 'Default web browser' in the Safari settings dialog.
Since OS X v10.4, this behaviour has been driving me to distraction. This is a known problem, and has been widely reported by FileVault users (see this hint, for instance). I was hoping that this would have been fixed with 10.6.2, but alas, the problem continues. So I set out to solve it.
[554 views]
I wrote some proof-of-concept code that allows you to use the Apple Magic Mouse to zoom in/out in the frontmost application with pinch gestures. I've detailed the process of how I got this working in this entry on my blog, including some compilable source code that implements pinch for zoom in/out (in Preview, for instance).
[ robg adds: The referenced blog post walks is quite technical, and the end result is some source code that can be compiled to add pinch gesture functionality to the Magic Mouse (you'll need Xcode installed to compile it). As this is a very technical hint, I've chosen to simply link to the blog post instead of recreating it here in full. However, in case the blog ever vanishes, I have recreated the source code in the body of this hint -- but check the blog post first for updated versions.]
[680 views]
Like many people, I have customized many thing about my OS X setup, not the least of which were app and folder icons. Via programs like CandyBar or LiteIcon, or manually, any and all folder/file/app icons can be changed.
Personally, I like the pure|icns set from Interfacelift. However, there is a problem when programs update -- in my case, Dropbox -- and change their icons back to a boring old Leopard blue. To return my custom icons, I wrote an AppleScript. Since this only happens every now and then, I didn't make the script executable; I just call it from Google's quick search box whenever I need it.
At any rate, this script will copy an icon from some location (file, folder, *.icns), and paste it via the Get Info window for any second location (file, folder, app) that you desire. Of course, change the first two POSIX paths to (1) where the icon should come from, and (2) where the icon should go.
This script contains modified code from this script.
[ robg adds: I haven't tested this one.]
[1,340 views]
The Magic Mouse lets you navigate forward and backward between web pages in Safari or Firefox with a two-finger swipe.
The same two-finger swipe also moves you forward and back in iCal. It works just the same as clicking the forward and back arrows around the day/week/month view control at the top of the iCal window.
[992 views]
Back up OS X to a Windows machine on the network
Fri, Nov 20 2009 at 7:30AM PST • Contributed by: Anonymous
I know there are plenty of back up/synchronization packages for the Mac, and I know Time Machine is awesome. But as I have a Linux/FreeBSD background, I wanted to do it my way. And none of the software I tried was able to do it my way :-). So the command line seemed to be a good solution.
My office Windows machine has plenty of disk space on it, and it is rarely used. It was an ideal system (with not so ideal a file system) to do backups on. The solution I came up with requires:
- A shared folder on the PC, mounted on the Mac.
- The Unix app rdiff-backup, available via MacPorts.
- Notifications are sent using growlnotify, part of the Growl notification system.
The final step was to write a custom shell script to back up my Mac to the mounted Windows shared folder; here's what that looks like:
#!/bin/bash
# my backup script in /Users/mkljun/backup.sh
DestinationIP="148.88.226.250"
SourceIP=`ifconfig | sed -n '/en0/,/media/p' | grep -v inet6 | grep inet | awk '{print $2}'`
LOGFILE="/Users/mkljun/backup.log"
SourceDir="/Users/mkljun"
DestinationDir="/Volumes/mkljunHome/BackupMac"
SambaDrive="smb://mkljun@MKLJUNDESKTOP/mkljunHome"
## delete a log file if bigger than 50M
# check if the file exists otherwise create it
if [ ! -f $LOGFILE ]; then `touch $LOGFILE`; fi
LOGSIZE=`ls -l $LOGFILE | awk '{print $5}'`
echo "Size of $LOGFILE = $LOGSIZE bytes." >> $LOGFILE 2>&1
if [ $LOGSIZE -gt 50000000 ]; then rm $LOGFILE; fi
echo "************************************************************" >> $LOGFILE 2>&1
date >> $LOGFILE 2>&1
echo "************************************************************" >> $LOGFILE 2>&1
echo "Pinging destination machine $DestinationIP:" >> $LOGFILE 2>&1
# ping destination (backup) ip address; output redirected to a log file
ping -c 1 $DestinationIP >> $LOGFILE 2>&1
# check if ping successful
if [ $? != 0 ]
then
# if ping command not successful, print notification (echo should be in one line!!)
echo "-t 'Backup failed' -m 'Your IP is $SourceIP. Backup PC $DestinationIP could not be reached'" | xargs /usr/local/bin/growlnotify
echo "Pinging failed" >> $LOGFILE 2>&1
else
# mount samba drive (it should be one line)
osascript -e "try" -e "mount volume \"$SambaDrive\"" -e "end try" > /dev/null 2<&1
# check if mount was successful
if [ $? == 0 ]; then
# this echo should be in one line with a pipe
echo "-t 'Backup' -m 'Your IP is $SourceIP. Starting backing up now'" | xargs /usr/local/bin/growlnotify
echo "Backing up" >> $LOGFILE 2>&1
rdiff-backup $SourceDir $DestinationDir >> $LOGFILE 2>&1
# if rdiff-backup
if [ $? == 0 ]; then
echo "-t 'Backup' -m 'Backup completed successfully'" | xargs /usr/local/bin/growlnotify
echo "Backup completed successfully" >> $LOGFILE 2>&1
else
echo "-t 'Backup failed' -m 'Something was wrong'" | xargs /usr/local/bin/growlnotify
echo "Backup failed" >> $LOGFILE 2>&1
fi
# delete all backups older than 2 weeks
rdiff-backup --remove-older-than 2W $DestinationDir >> $LOGFILE 2>&1
fi
fi
You can read the entire tutorial on my blog, and download the latest version of the script.
[ robg adds: I've copied the script as it currently exists here, just in case the blog entry ever goes away. However, check the linked blog entry first for a newer version, and to read the details on how it works.]
[1,289 views]
If your bootloader gets changed or corrupted, this fix will restore it without damage to your disk partitions.
This hint may be a bit esoteric, but I thought I was up for a long night of reinstallation pain before stumbling upon this fix. I made the mistake of trying to use an Ubuntu 9.04 boot CD to install Ubuntu to an external (USB) drive on my Mac.
Don't do this, unless you know the following: Regardless of the fact that you chose the external drive upon which to install Ubuntu, you won't be able to boot back into your Mac without changing the bootloader. I ended up with the dreaded question mark folder when I tried to reboot my Mac, and nothing worked to boot into my OS X partition.
Luckily, I have a bootable external drive with OS X on it, and I was able to boot into it by holding down the Option key (the primary partition still did not show up).
[1,245 views]
10.5: Sync Sunbird calendars using iSync
Thu, Nov 19 2009 at 7:30AM PST • Contributed by: raboox8
 This hint is for Tiger only -- you'll have to modify it on Leopard or Snow Leopard, because of changes to iCal's folder structure.
I've recently switched to Mozilla Sunbird because it looks a lot nicer and runs faster than iCal, although it can't directly use iSync, so I can't synchronize the calendars on my laptop with my phone. By looking around in iCal's folder, I found out that you can copy a calendar file (.ics) from Sunbird into iCal and use that to synchronize with iSync. You can then load that synchronized calendar back into Sunbird.
There's a lot of mucking about, but it's well worth it :).
[1,086 views]
Add a Show Desktop icon to the Dock
Thu, Nov 19 2009 at 7:30AM PST • Contributed by: mlnoone
Wouldn't it be nice to activate Exposé's Show Desktop mode via an icon on the Dock? Here's how to make one that does just that. However, be warned: this works only one way -- it shows the Desktop, but on clicking again, it does not bring the windows back. To get out of Exposé's Show Desktop mode, just click anywhere along the darkened screen border.
- Create an AppleScript application. Open AppleScript Editor (Applications » Utilities » AppleScript Editor in 10.6) and paste in this code:
(* Show Desktop AppleScript by Mohan Noone, 2009 *)
activate application "Finder"
do shell script "/Applications/Utilities/Expose.app/Contents/MacOS/Expose 1"
- Save the script, name it something like Show Desktop, set the File Format to Application, and select the Run Only option in the Save dialog.
- Optional: change the boring script icon. Select the saved file in Finder and hit Command-I to open the Get Info Window, then do the same for the file with the icon you'd like to use. Then select the better icon from its Get Info Window, copy it (Command-C), select the script icon in the other Get Info window, and paste (Command-V).
- Drag the saved file to the Dock.
Your Show Desktop icon is ready for use!
[ robg adds: This works in 10.5 and 10.6, at least. For use in 10.5, you'll need to take /Utilities out of the do shell script line. I'm also not sure why you need to activate the Finder first; it seems to work fine for me with just the shell script line. Note that you can activate Exposé's other modes in this manner -- change 1 to 2 and you'll get Exposé's Application Windows mode, and 3 gets you All Windows mode.]
[1,660 views]
First | Previous | 1 2 3 4 5 6 7 8 9 10 | Next | Last
|
|
User Functions
Don't have an account yet? Sign up as a New User
Lost your password?
What's New in the Forums?
The Editor's Corner...Here are some of my ( robg) other projects...
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,756 votes | 42 comments
|