Category Archives: HowTo

Free AppleScript for finding duplicates in the Apple Photos App on OS X

If you have a huge Photos library on the Mac, you very likely have a bunch of duplicate photos. People have also found that duplicates photos are sometimes created when you upgrade from iPhoto or Aperture to Photos. Unfortunately, if you look at the “free” programs on the App Store, you find that they are generally either scams or teasers for a paid version.

So, I wrote an AppleScript to go through every photo selected in Photos (you can select your entire library easily, if you want) and create a new Album with just the duplicate photos found. The script can be copied to your Photos script folder (if you have the script menu enabled) or you can just run it from with ScriptEditor. I also created a small script to reveal the ID of a selected photo, which can be useful for debugging the library and/or finding an original file within the inscrutable Photos database. Most people (if anybody) will just want the Find Duplicates script. Download them at the link below:

Photos AppleScripts

Once the script finds any duplicates, it creates a folder called “Duplicates” and adds a new album with the found duplicates. You should then go through that album and confirm that the duplicates are legitimate. If they are, select which the one duplicate you want to remove (you won’t want to get rid of the entire pair, presumably), right click and select delete. Make sure you don’t delete both in the pair, but if you do it’s not the end of the world; they will stay in the deleted photos album for a month.

Let me know if something doesn’t work right. The Photos AppleScript library doesn’t allow any destructive operations other than deleting albums (which I don’t do in either script) so the worst case should be that if it doesn’t work it just doesn’t find duplicates that it should.

Update: As a couple folks pointed out in the comments, the next step will be to create a script that allows you to “merge” a pair of photos, moving all the album associations and tags onto just one. I haven’t looked into whether this can even be accomplished with the Apple Script hooks available in Photos, so if anybody has an insight I’d appreciate it.

How to correctly set your car’s sideview mirrors

When I first started driving, like most people I know I set my sideview mirrors so that I could always see the side of the car. It seemed like the right thing to do. However, this leaves one with a huge blind spot, especially just off to your back left. At the time, I figured you just had to turn around to properly clear yourself before changing lanes, and I didn’t understand why we even bothered to have sideview mirrors. Fortunately, not long after I got my license, my insurance company decided to put a little set of instructions in their monthly newsletter for young drivers on how to properly set the mirrors. It turns out the car companies actually know what they’re doing with the whole mirror situation, it’s just that most of us don’t. Here’s how they’re supposed to work:

The problem with the way most people set up their mirrors is that they render the sideview mirrors almost completely redundent with the rearview (center) mirror by aiming them essentually straight back, so that you can see what’s pretty much straight behind you, including the side of your car, but not much to the side. But the sideview mirrors are actually supposed to cover very little: just the area between what you can see out the back with the rearview, and what you can see with your peripheral vision. With properly set mirrors you should be able to see everything without moving your head. You should be able to see a car coming from behind you in either lane in your rearview mirror, and as it leaves your rearview mirror it should be just coming into your sideview, and as it leaves your sideview mirrors it should be coming up directly beside you in your peripheral vision. You should thus be able to change lanes by moving your eyes, not your head.

Given differences in people’s cars (not to mention heads) the only way to get it perfect is to experiment, making sure that you never lose complete sight of a car passing you on either side. You can do this safely while stopped at a light as cars pulls up beside you, or you can adjust them while parked on the side of a street. To get a very good first approximation, do the following (this is the method USAA recommends):

  1. Set the rearview so that you can see straight backwards.
  2. Stick your head up right against the driver side window, and adjust your left sideview mirror so that you can just begin to see the left side of your car.
  3. Put your head in the middle of the car, between the driver and front passenger’s seat and adjust your right mirror until you can just see the right side of the car.

When you are in a normal driving position, you won’t be able to see your own car in your sideview mirrors. You’ll probably find driving like this disconcerting at first because all you can see on the side mirrors is the side of the road rushing by, with no visual reference to let you know exactly where you’re looking. In fact, you won’t be able to see anything in your sideview mirrors that you can see in your rearview. But that’s the point! If they are adjusted correctly, each mirror handles a certain angle of view behind you such that everything is covered, with no blindspot big enough for a car.

When changing lanes, all you need to do is check your rearview, and then glance to the appropriate sideview to make sure it’s not filled with car. If you just see a blur of road rushing by, you’re clear. It takes a while to learn to trust it, and for me the only way I could do so was to verify several times that I never lost sight of a passing car as I was driving.

Unlike most of my posts, this isn’t just meaningless pedantry. The whole idea is that if you have your mirrors adjusted correctly, you never need to turn your head around to change lanes, thus always keeping your head pointed where you’re going. Turning around to check what you might bump into while changing lanes is really a bad idea when it leaves you not looking at what you’re headed towards at 65 MPH.