<< DiscussionsReply

Macro - Set Selected Index?

Jeff Mason
4 discussion posts
Is it possible (via a macro) to tell ClipboardFusion which item to select by specifying an index?
I'm hoping to replicate some functionality in the clipboard manager app I've been using previously, where you could select an item in the clipboard history and then each time you clicked paste it would move to the next item in the history.
The idea being that you'd copy a number of values from a source document (using separate copy commands to create separate records in the clipboard history), eg
Joe Bloggs
123 My Street
My Town
My Country
And then, when invoking the macro using a hotkey, the first invocation would paste 'Joe Bloggs' and change the selected index to current index + 1. The next invocation would paste '123 My Street', the next would paste 'My Town', etc.
May 28, 2018  • #1
Thomas Malloch (BFS)'s profile on WallpaperFusion.com

There currently isn't any way to set the Clipboard Manager selected index, but I've added this to our feature request list and we'll be sure to let you know if/when we're able to implement it in a future version! In the meantime, I put together two Macros that should do the trick.

The first one, "Set Increment Index and Paste", will save the currently selected index and paste the item you had selected in the Clipboard History. Then you use the second Macro, "Increment Index and Paste" to keep pasting the next Clipboard History item in the list.

Here's how to get them into ClipboardFusion:

  • Download the files attached to this email and repeat the next steps for each file
  • Open the ClipboardFusion Settings window
  • On the "Macros" tab, click the "Import" button
  • Select a file you downloaded in the first step
  • In the window that pops up, you can review the code and assign the Macro a HotKey
  • Click OK to close the Macro Edit window, then OK again to save and apply your changes

I hope this works for you!
• Attachment: Increment Index and Paste.cfmacro [7,776 bytes]
• Attachment: Set Increment Index and Paste.cfmacro [7,880 bytes]
May 30, 2018 (modified May 30, 2018)  • #2
Jeff Mason
4 discussion posts
Thanks for this Thomas - very useful!
May 31, 2018  • #3
Jeff Mason
4 discussion posts
Any idea when BFS.Window.IsVisible might become available to Clipboard Fusion?
I'm close to getting your scripts to work as a single macro (and thus only one hotkey) by trying to detect if the Clipboard Manager is popped up.
The idea being that in my use case I always initiate the macro from the manager so if I know that's true (ie it's popped up) then the macro should set up the settings index before pasting. If it detects that the manager is not popped up, then it simply increments the index and pastes, etc.
Unfortunately IsVisible is not available yet, and GetFocusedWindow seems to ignore Clipboard Manager (quite reasonably, since 99% of macros probably want to know what the focused window was before the Clipboard Manager popped up!).
May 31, 2018  • #4
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Nothing like that exists in our functions yet, but I've added your request to our list, and we'll let you know when we implement it! In the meantime, I threw something together that should work for you. Here's the code:


Jun 4, 2018 (modified Jun 4, 2018)  • #5
Jeff Mason
4 discussion posts
Thanks Thomas. Your code works perfectly!
Jun 5, 2018  • #6
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I liked your idea of combining the Macros into one function so much I made a version as well! I attached the code to this post if you, or anyone else is interested.

• Attachment: Incrementing PowerPaste.cfmacro [18,504 bytes]
Jun 12, 2018  • #7
66 discussion posts
Great idea @Jeff Mason!
Thanks for elegant implementation, @Thomas Malloch - very useful.
To use "Incrementing PowerPaste" macro effectively, I need nicely arranged history: all items I intend to paste in desired order should follow strictly one after another in the history. Should we have a way to move items in history so that to re-order them? Sure, I can be disciplined and pay attention to how I copy things in the first place, but hey... we are not perfect.
Maybe allow users to re-arrange items in the History by drag-and-drop, or some other UI operation?
Jun 18, 2018  • #8
Was this helpful?  (4)  
<< DiscussionsReply