Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

Clipboard Alert

Description
This macro checks whether the copied text matches any string listed in C:\ListSearch.txt. If a match is found, it automatically opens the file ListAlert.txt with your prompt. The comparison is case-insensitive and ignores leading/trailing spaces.
Language
C#.net
Minimum Version
Created By
Serghei C.
Contributors
-
Date Created
11d ago
Date Last Modified
11d ago

Macro Code

using System;
using System.IO;
using System.Collections.Generic;

public static class ClipboardFusionHelper
{
    private static readonly string FilePath = @"C:\ListSearch.txt"; // Change to your path. Insert each string on a new line

    public static string ProcessText(string text)
    {
        string clipText = text.Trim();

        if (File.Exists(FilePath))
        {
            var watchList = new HashSet<string>(
                File.ReadLines(FilePath),
                StringComparer.OrdinalIgnoreCase);
                
            // Check if clipboard contains one of the values
            if (watchList.Contains(clipText))
            {
                BFS.Application.Start(@"C:\ListAlert.txt");  // Change to your path.
            }
        }

        return text;
    }
}