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?

Import Text File to Online Pinned Items

Description
This Macro will import each line from the specified text file and add them to your Online Pinned Items.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Nov 27, 2018
Date Last Modified
May 23, 2019

Macro Code

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

public static class ClipboardFusionHelper
{
	public static string ProcessText(string text)
	{
        // Prompt for the text file path
        string textFilePath = BFS.Dialog.GetUserInput("Paste in the path to the text file", "");
        textFilePath = textFilePath.Replace("\"", "");
        
        // Put each line from the text file into an array
		string[] textFileImport = File.ReadAllLines(textFilePath);
		
		// Loop through the array and create each line as a Pinned Item
		foreach (string line in textFileImport)
		{
            BFS.ClipboardFusion.CFOSavePinnedText(line);
		}
		
		// Leave the clipboard as-is
		return null;
	}
}