Title

Message

Confirm

Want to earn a free ClipboardFusion Pro license? We're looking for ClipboardFusion translators!
<< DiscussionsReply

How to create macros that emulate keystrokes?

Avatar from Gravatar.com
Leon André Bergman
41 discussion posts
As a person who has no coding experience, and does not know C# at all, but have used ArsClip in the past, I would like some input on how I could make some macros work like I want.

I work with some systems that need to perform a lot of selections in different dropdowns and such, on webpages, and in my current program, I can simply tell the macro to run key strokes by writing [TAB REPEAT=1][ENTER REPEAT=2], this will make it Tab to the next selection and hit enter.

I know you have the BFS.Input.SendKeys function in C#, and I am sure it can do the same thing, but how does this work?
Oct 30, 2017  • #1
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I've attached a Macro that should work for you. Here's how to get it into ClipboardFusion:

  • Download the file attached to this post
  • Open the ClipboardFusion Settings window
  • On the "Macros" tab, click the "Import" button
  • Select the 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: Tab Once, Enter Twice.cfmacro [5,920 bytes]
Oct 30, 2017  • #2
Avatar from Gravatar.com
Leon André Bergman
41 discussion posts
Thank you. This is pretty helpful. AS long as I can figure out what the correct name for all the keys are, I can make some interesting macros. How about adding a wait timer. Is there a code for that?
Oct 30, 2017  • #3
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I've put together another macro that should show you how to add a delay to your code. I hope it works for you!
Oct 31, 2017  • #4
Avatar from Gravatar.com
Leon André Bergman
41 discussion posts
thank you. Ive been tinkering with it all day, and I got my full macro to work, with about a houndred lines of code. I also figured out the wait timer.
Oct 31, 2017  • #5
Avatar from Gravatar.com
Frank99
32 discussion posts
Hi, I want to do this too, but I want the hotkey to to send the keystrokes only when a certain window is active. How can I add that condition?
Jan 14, 2019  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@Frank: You can wrap the code in an if statement that checks the window title of the focused window, like this:

Code

Jan 16, 2019  • #7
Was this helpful?  Login to Vote(2)  Login to Vote
<< DiscussionsReply