The automated macro rail is an accessory meant for focus stacking of images. The basic operating principle is that, since in macro photos depth of field is often hair thin, one could generate a macro photo with a greater depth of field by shooting multiple photos of the subject while sweeping the focal plane across the subject, and then combining the in focus regions of each photo. The box has three main modes. The first is manual control and positioning mode, in which the actuator is simply mapped to the top mounted linear potentiometer. The second mode is internal program mode, in which the box can perform one of a number of set routines, taking a specified number of pictures with a specified distance between pictures. Since the box interfaces with the camera's shutter switch, the rail can be left to run one of these sequences unattended, activating the camera by itself. The final mode is PC link mode. The box's code contains a serial command interface, with a UI similar to Zork, a classic computer game. The attached computer can command the actuator to go to specified positions, take pictures, and even set up routines similar to the internal program mode routines, but with much more flexibility. The code also contains safeguards, and will reprimand the user for trying to perform illegal actions, such as moving the camera off of the end of the rail.