Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
TrayStatus
VoiceBot
WallpaperFusion
Clipboard
Fusion
by Binary Fortress Software
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
Features
Features
HotKeys
Macros
Triggers
Clipboard Syncing
Clipboard Manager
Languages
Free vs Pro
Apps
More
Screenshots
Macros
Languages
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Purchase
Login / Register
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Copy Text/Image/Files to Local Pinned Slot 01
Return to ClipboardFusion Macros
Description
This macro will copy the selected text/image/files and put it in Local Pinned Slot 01. For images, depending on where you're copying them from, you may need to copy the image manually first, then run this Macro. Duplicate this macro and change the slot number on line 17 to use it for other Local Pinned slots.
Language
C#.net
Minimum Version
5.6+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Aug 13, 2019
Date Last Modified
Aug 13, 2019
Macro Code
Copy
Select All
using System; using System.Collections.Generic; using System.Windows.Forms; using System.Drawing; // 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) { // Set the slot number here (it's 0 based, so 0 is slot 1, 1 is slot 2, etc) int slotNumber = 0; // Send the copy command BFS.Clipboard.Copy(); // Put the item in the local pinned slot if (BFS.Clipboard.HasText()) // Text { BFS.ClipboardFusion.SetLocalPinnedFileList(slotNumber, null); BFS.ClipboardFusion.SetLocalPinnedImage(slotNumber, null); BFS.ClipboardFusion.SetLocalPinnedText(slotNumber, BFS.Clipboard.GetText()); } else if (BFS.Clipboard.HasImage()) // Image { BFS.ClipboardFusion.SetLocalPinnedFileList(slotNumber, null); BFS.ClipboardFusion.SetLocalPinnedImage(slotNumber, (Bitmap)Clipboard.GetImage()); BFS.ClipboardFusion.SetLocalPinnedText(slotNumber, "Image"); } else if (Clipboard.ContainsFileDropList()) // Files { string[] files = new string[Clipboard.GetFileDropList().Count]; Clipboard.GetFileDropList().CopyTo(files, 0); string itemLabel = string.Join("\r\n", files); BFS.ClipboardFusion.SetLocalPinnedFileList(slotNumber, files); BFS.ClipboardFusion.SetLocalPinnedImage(slotNumber, null); BFS.ClipboardFusion.SetLocalPinnedText(slotNumber, itemLabel); } return null; } }