Macro Recorder » Including C# code into a macro

Including C# code into a macro

Good news for all advanced users: the latest version of our Macro Recorder supports adding C# code snippets into a macro! Whether you need working with variables or just require some custom action that is not (yet) provided by Macro Recorder's standard set of built-in commands, simply insert a "Run C# code" command into your macro, you'll find it in the "Insert" menu along with all the other commands.

Note this when adding C#-snippets to macros:

Your code snippet must contain a "Program" class with a static method "Main()". This will be the entry point for your snippet. Like this:

public class Program
{
	public static void Main()
	{
		System.Windows.Forms.MessageBox.Show("Hello world");
	}
}

Of course you can include other classes and namespaces in the snippet, just be sure to include the "Program" class as well:

public class Program
{
	public static void Main()
	{
		System.Windows.Forms.MessageBox.Show("Yo!");
	}
}

namescape MyAwesomNamespace
{
	public class MarioBro
	{
		public void Jump()
		{
			//Kriss Kross will make you
		}
	}
}

more whitepapers Including C# code into a macro

Macro Recorder