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?

Confirm

Are you sure?

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]
Sep 25, 2019  • #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
Oct 3, 2019 (modified Oct 3, 2019)  • #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]
Oct 4, 2019  • #8
Frank99's profile on WallpaperFusion.com
Works, thanks!
Oct 5, 2019  • #9
Frank99's profile on WallpaperFusion.com
What would I need to add to this so that it automatically pasted the result where the cursor is?
Nov 13, 2019  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Before the "return text;" line on line 24, add a line like this:

BFS.Clipboard.PasteText(text);
Nov 13, 2019  • #11
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)