Title

Message

Confirm

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

help with simple macro

Frank99's profile on WallpaperFusion.com
Hi, can someone help me create a macro to do the following? In another program, Shift+Alt+B copies something to the clipboard (let's say it puts "Bob" there), and Shift+Alt+C copies something else to the clipboard (let's say "Carl"). I want to have a macro that will put "Bob Carl" (the results of Shift+Alt+B, a space, and the results of Shift+Alt+C). Ideally, the code will be clear enough that I can change the specific shortcuts involved (Shift+Alt+B or C) later if needed. Thanks!
Jul 26, 2019  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
To clarify, do you just need the macro to put the last 2 clipboard items together, or you need a macro to automatically copy some text from one program, then copy text from another program, then put them together?
Jul 26, 2019  • #2
Frank99's profile on WallpaperFusion.com
I don't want to just combine the last 2 items. I want to use a hotkey to trigger a macro to do the following all in order without pausing:

1. Check if a window "Program" is active (do nothing if it is not, if it is then...)
2. Send Shift+Alt+B to the program, which will put "Bob" on the clipboard
3. Send Shift+Alt+C to the same program, which will put "Carl" on the clipboard
4. Combine Bob and Carl to put "Bob Carl" on the clipboard (actually, I'd like to be able to choose later whether to put a space or "new line" marker between them)

Then stop. And then I will be able to go to another program and use Control+V to paste "Bob Carl" in the other program.

Thank you!
Jul 27, 2019  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, give this a try! I'm not 100% sure it will work, it depends on whether the program will accept the sendkeys from ClipboardFusion.
• Attachment: Copy from application and concatenate.cfmacro [8,216 bytes]
Jul 29, 2019  • #4
Frank99's profile on WallpaperFusion.com
Hi, unfortunately, it didn't work, but I'm sure it's the other program rather than you. Can we try your other idea--a script to concatenate the last 2 clipboard items with a space between them and put that on the clipboard, ready to paste? Thank you.
Aug 26, 2019 (modified Aug 26, 2019)  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, try this one out then. Copy the first name first, then the second name, then run the macro, which should then put "FirstName LastName" on the clipboard.
• Attachment: Concatenate last 2 history items.cfmacro [5,640 bytes]
28 days ago  • #6
Frank99's profile on WallpaperFusion.com
Thanks, it works, but can you modify it so it concatenates the items and also pastes them at the current cursor location?

Also, can it concatenate with the 1st copied (i.e., older) item pasted in front of the 2nd copied item? So:

copy: first
then copy: second
[trigger macro]
pastes: first second
20 days ago (modified 20 days ago)  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Sure thing, give this one a try.
• Attachment: Concatenate last 2 history items.cfmacro [5,640 bytes]
19 days ago  • #8
Frank99's profile on WallpaperFusion.com
Works, thanks!
18 days ago  • #9
Was this helpful?  Login to Vote  Login to Vote
<< DiscussionsReply