This is an action (not a script) called "254" to help you blow out that almost-white background to 100% white. It uses the Dodge tool and an adjustment layer for Threshold to make it really simple to see what is pure white.
Downloading and installing
Right-click on the download button and choose "Save as..." to obtain whitebg.atn. Make sure the file name is not changed by your web browser. Double-click on whitebg.atn to load it into Photoshop's action palette. Alternatively, use the menu Load Actions... in the action palette to load whitebg.atn. The action is called "254" because that is the threshold for pure white.
Using the action
When you run "254", a threshold adjustment layer is created and the dodge tool is invoked. With the adjustment layer, areas that are not 100% white are shown as gray, making it easier to see what needs to be blown out. The dodge tool set to highlights and 10% lets you blitz areas that are almost blown out, without changing adjacent objects that represent midtones and shadows.
When the background is pure white you can just delete the threshold adjustment layer. Please look at the Youtube-video to see how it all works.
The white background action is ©Kjell Post. Use it or abuse it, but please don't pretend you wrote it. Feel free to contact me if you are in need of Photoshop scripting.