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?

User Image
Leon André Bergman
60 discussion posts
When I open the history Menu, and try to run a macro, the macro runs on that history menu, instead of in the text field I selected before opening the history menu.
What am I doing wrong?

I'm trying to create a macro that can jump to different fields within a form, and as a test I've started out with running 1 TAB, and 1 Enter function, to see if it skips to the next element, and enters it.

The macro causes a loop, as the macro tabs within the macro menu and activates itself again.

How do I get it to switch back to the program I was in, and run the macro there?

The macro I am running is this:

Code

using System;
using System.Collections.Generic;

// 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)
{
        //for more key codes, check out this website:
        //https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys(v=vs.110).aspx

        //send the tab key
        BFS.Input.SendKeys("{TAB}");

        //send the enter key
        BFS.Input.SendKeys("{ENTER}");

        //tell ClipboardFusion to ignore the result of this macro
return null;
}
}
Oct 31, 2017  • #1
User Image
Dmiitry
71 discussion posts
You don’t need to open History menu to run this macro. First, assign it some Hot Key. Then go and open your application, say web page in browser or simply type some text in Notepad. Do not select anything. Now press your hot key - macro sends TAB + ENTER keystrokes directly to browser or Notepad.

Your idea for this macro is very good, I find it useful and used it few times today
Oct 31, 2017  • #2
User Image
Leon André Bergman
60 discussion posts
Thank you Diimtry for your reply.
I realise I can just add it to a hot-key, but in my line of work, I want to be able to have a host of macros for different outcomes in a case, and I will soon run out of hot-keys to use.
And it will be very inconvenient to not be able to quickly look at a list of macros, and choose the one I need in that particular instance.

You are able to open the history window, and choose from the clipboard, and it pastes it in the text field you had active, not in the History window, so I would have expected the macros to function the same.

It is a very useful macro, and it has endless possibilities in making my day more efficient.
Oct 31, 2017  • #3
User Image
Leon André Bergman
60 discussion posts
To explain in more detail.
This is a macro I am using in my current clipboard app.

Code

[KEY="001009SHIFT+TAB"]
[WAIT=500]
[KEY="001009SHIFT+TAB"]
[WAIT=500]
[KEY="001009SHIFT+TAB"]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[DOWN REPEAT=5]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[TAB REPEAT=2]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[DOWN REPEAT=6]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=200]
[TAB REPEAT=1]
<predefined text here>
[WAIT=500]
[TAB REPEAT=2]
[WAIT=500]
[RIGHT REPEAT=2]
[WAIT=500]
[TAB REPEAT=9]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[DOWN REPEAT=1]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[TAB REPEAT=3]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[DOWN REPEAT=12]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[TAB REPEAT=32]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[DOWN REPEAT=1]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[TAB REPEAT=3]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[DOWN REPEAT=2]
[WAIT=500]
[ENTER REPEAT=1]
[WAIT=500]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[KEY="001009SHIFT+TAB"]
[WAIT=500]
[RIGHT REPEAT=3]

I use this macro to automatically close a ticket in our ticketing system.
In this case, it is a major outage ticket, with a predefined text that I have removed.

I am able to open that other apps history tab, and look at all my other pinned clipboard items and macros, and choose what I need for the occasion, and it will close the history and paste it in the browser.

I saw ClipboardFusion and thought it could replace my existing app, as I think CF opens me up to even more possibilities.

I converted the above macro, to this:

Code

using System;
using System.Collections.Generic;

// 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)
{
        //for more key codes, check out this website:
        //https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys(v=vs.110).aspx

        //send the tab key
        //BFS.Input.SendKeys("{TAB}");

        //send the enter key
        //BFS.Input.SendKeys("{ENTER}");
        

        //tell ClipboardFusion to ignore the result of this macro
//return null;
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{TAB}");
//Need code to paste predefined text here.
//--------------------------

//--------------------------
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{RIGHT}");
BFS.Input.SendKeys("{RIGHT}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{TAB}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{DOWN}");
BFS.Input.SendKeys("{ENTER}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{+TAB}");
BFS.Input.SendKeys("{RIGHT}");
BFS.Input.SendKeys("{RIGHT}");
BFS.Input.SendKeys("{RIGHT}");
return null;
}
}


Now, when I ran this macro, it caused a BSOD, so I need to find out what exactly went wrong, and therefore, start on a smaller scale, to work myself up.
I am guessing it has to do with wait times between commands.
I think "BFS.General.ThreadWait" can help here, but it will not be useful if I can't select the macro from a list, instead of running a hot-key every time.

EDIT: I found out that the primary fault with my Macro was {+TAB}. It should have been +{TAB}.
This has fixed everything, except starting the macro from the Macros tab on the History Popup.
Oct 31, 2017 (modified Oct 31, 2017)  • #4
User Image
Greg100
1 discussion post
Hi.

I too am having this problem (where you can't use the macro from the menu and have the results go into the active window). The hotkeys provides a way around it, but I'd prefer not to have to remember too many hotkeys. Or put another way, I can't remember that many hotkeys.

Does anyone know if anything has changed since this forum post was originally created which might mean it can now be performed via the menu?

Thanks for any help that can be provided.
Jan 22, 2020  • #5
User Image
Leon André Bergman
60 discussion posts
The way I got around this was that I switched from using keyboard commands like TAB to navigate, and now use the mouse input commands to move the mouse and click. so I just need to make sure the macro window is not in the area where the first click is.
Jan 22, 2020  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Just a quick update here, we're going to investigate the possibility of adding an option to pass focus back to the previous window before starting the Macro when it's run from the Clipboard Manager window.

We'll be sure to let you know if/when we're able to add that.

Thanks!
Jan 31, 2020  • #7
User Image
Leon André Bergman
60 discussion posts
I suggest making selecting a macro from the menu, forces the window to close before the macro starts.
Jan 31, 2020  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
We've just posted ClipboardFusion 5.8 Beta 1, and there's now an option to have ClipboardFusion pass the focus back to the previously focused window before running the macro.

Hope that helps!
Jun 18, 2020  • #9
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)