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?

Phrase Picker

Description
This script uses key-value pairs to allow choosing a defined phrase from a dropdown for keyboard stuffing using BFS.Input.SendText().
Language
C#.net
Minimum Version
Created By
Gregory Diebold
Contributors
-
Date Created
Feb 6, 2024
Date Last Modified
Feb 6, 2024

Scripted Function (Macro) Code

using System;
using System.Linq;
using System.Collections.Generic;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		Dictionary<string, string> keyValuePairs = new Dictionary<string, string>()
		{
			{
				"Phrase #1", "This is Display Fusion 'typing' your Phrase #1"
			},
			{
				"Phrase #2", "This is Display Fusion 'typing' your Phrase #2"
			},
			{
				"Phrase #3", "This is Display Fusion 'typing' your Phrase #3"
			},
			{
				"--------------", ""
			},
			{
				"Phrase #4", "This is Display Fusion 'typing' your Phrase #4"
			}
		};


		string[] aryOptions = keyValuePairs.Keys.ToArray();
		string input = BFS.Dialog.GetUserInputList("Auto-Fill", aryOptions);

		// Retrieve a value using a key
		string value;
		if (keyValuePairs.TryGetValue(input, out value))
		{
			BFS.Input.SendText(value);
		}
		else
		{
			BFS.Dialog.ShowMessageError($"{input} key was not found in the dictionary.");
		}
	}
}