You can script the search and replacement of colours… It will NOT be anything like the speed of the built-in app ones as they are provided by plug-ins and are much faster…
Depending on your app version you may be able to record action and play that out…?