Photoshop Scripting: batch replace colors


I'm trying to write a script that will replace the colors of all same-colored shapes, including those on non-visible layers. I am new to Photoshop scripting, but I imagine the pseudocode would work something like this:

for (all shape layers)
  if (fill color = #123456)
    fill color = #000000

Is this possible to do?

I tried running the script here, but got an error at 'executeActionGet' (This functionality may not be available in this version of Photoshop). I am using Photoshop CS6.

4/24/2015 6:56:00 PM