You can specify conditions for a mode change so that the conversion can occur during an action, which is a series of commands applied sequentially to a single file or a batch of files. When a mode change is part of an action, an error can occur if the file being opened is not in the source mode specified in the action. For example, suppose one step in an action is to convert an image with a source mode of RGB to a target mode of CMYK. Applying this action to an image in Grayscale mode, or any other source mode besides RGB, results in an error.
When you record an action, you can use the Conditional Mode Change command to specify one or more modes for the source mode and a mode for the target mode.