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 Queue: Add to Queue

Description
Implements the add functionality of what I'm calling a clipboard queue. Every add operation copy the current clipboard text to the queue while every paste pastes everything in the queue and clears the queue.
Language
C#.net
Minimum Version
Created By
William Rawls
Contributors
-
Date Created
Aug 24, 2021
Date Last Modified
Aug 24, 2021

Macro Code

using System;

public static class ClipboardFusionHelper
{
	public static string ProcessText(string text)
	{
        // Preserve the clipboard before copying the app's selected text
        string originalClipboardText = BFS.Clipboard.GetText();
        string clipboardText = BFS.Clipboard.CopyText();
        BFS.Clipboard.SetText(originalClipboardText);
        
        if(string.IsNullOrEmpty(clipboardText))
            return text;

        clipboardText = clipboardText.Replace(@"\r", "");

        string clipboardQueue = BFS.ScriptSettings.ReadValue("ClipboardQueue1");

        if(string.IsNullOrEmpty(clipboardQueue))
            clipboardQueue = clipboardText;
        else
            clipboardQueue += clipboardText;

        // BFS.Dialog.ShowMessageInfo(">>>" + clipboardQueue + "<<<");

        if(clipboardQueue.Length > 0)
            BFS.ScriptSettings.WriteValue("ClipboardQueue1", clipboardQueue);

		return text;
	}
}