     
     @objc private func validateObject() {
         
-        self.hasInvalidSetting = (self.representedObject as? BatchReplacement)?.replacements.contains(where: { $0.localizedError != nil }) ?? false
+        guard let batchReplacement = self.representedObject as? BatchReplacement else { return }
+        
+        self.hasInvalidSetting = batchReplacement.replacements.contains { $0.localizedError != nil }
+        
+        self.canPerform = batchReplacement.replacements.contains { replacement in
+            do {
+                try replacement.validate()
+            } catch {
+                return false
+            }
+            return true
+        }
     }
     
 }

        self.resultMessage = nil
        
        guard
            let textView = TextFinder.shared.client,
            let string = textView.string
            else {

    
    /// reset previous search result
    override func viewWillAppear() {
        
        super.viewWillAppear()
        
        self.resultMessage = nil
    }
