Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Russell Deacon
1 discussion post
Hi, Is it possible to define a macro to run automatically when content is copied to the clipboard? I would like to create a macro to call Google Translate as soon as text is copied to the clipboard. I an trying to convert a large number of text strings and it would be so nice to simply highlight > clipboard copy > and then paste back translated text. From what I was able to find so far you can create a hotkey to launch a macro but nothing to have one run automatically when new clipboard content is detected.

If its not already possible, maybe where you define the hot key to launch the macro's you could add an "Auto Run" or "Auto Double Copy Run".

Thans Russ
May 7, 2012  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You can have the highlighted text automatically copied when running the macro by adding the following line as the first line in your ProcessText function:

MacroAPI.CopyText(out text);

For example, when running this macro using it's HotKey it will automatically copy the selected text and put the modified text in the clipboard which you can then paste. That way you can skip the step of having to copy the text to the clipboard using CTRL+C :)

Code

using System;

public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
MacroAPI.CopyText(out text);
return "http://testlink.blah/?ID=" + text;
}
}
May 10, 2012 (modified May 10, 2012)  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)