Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
cbarbosa
1 discussion post
Hey all. First of all thanks for the help in advance.

I am trying to create a macro to help me fill out forms with text from my clipboard. I would like my text to paste the first value i copied and then press tab to the next entry, then paste the second value i copied and then press tab to the next entry, and so on. This is the best i got and so far it will only paste the first and second value.

Code

using System;
using System.Collections.Generic;

// The 'text' parameter will contain the text from the:
// - Current Clipboard when run by HotKey
// - History Item when run from the History Menu
// The returned string will be:
// - Placed directly on the Clipboard
// - Ignored by ClipboardFusion if it is 'null'
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
// Tell ClipboardFusion to ignore any changes to the Clipboard.
// Depending on your settings, pasting text could modify the history
BFS.ClipboardFusion.PauseClipboardListener();

// Get the first item from the Clipboard History
text = BFS.ClipboardFusion.GetHistoryText(0);

// Paste the text to the active window
BFS.Clipboard.PasteText(text);

// Press the "Tab" button
BFS.Input.SendKeys("{TAB}");

// Get the second item from the Clipboard History
text = BFS.ClipboardFusion.GetHistoryText(1);

// paste the text to the active window
BFS.Clipboard.PasteText(text);

// Press the "Tab" button
BFS.Input.SendKeys("{TAB}");

// Get the third item from the Clipboard History
text = BFS.ClipboardFusion.GetHistoryText(1);

// paste the text to the active window
BFS.Clipboard.PasteText(text);

// Press the "Tab" button
BFS.Input.SendKeys("{TAB}");

// Get the fourth item from the Clipboard History
text = BFS.ClipboardFusion.GetHistoryText(1);

// paste the text to the active window
BFS.Clipboard.PasteText(text);

// Press the "Tab" button
BFS.Input.SendKeys("{TAB}");

// Tell ClipboardFusion to start watching the Clipboard again
BFS.ClipboardFusion.ResumeClipboardListener();

// Tell ClipboardFusion to ignore the return from this Macro
return null;
}
}


Looking forward to hearing back from you : )
Jan 7, 2021 (modified Jan 7, 2021)  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

Can you try increasing the "BFS.ClipboardFusion.GetHistoryText(0);" value by 1 each time you call it, and see if that helps?

Thanks!
Jan 12, 2021  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)