Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
roel.vanhout
1 discussion post
When you right-click an email address in Outlook and select 'Copy', the following is copied to the clipboard:

John Doe

Which is then of course scrubbed so that only 'John Doe' remains. Is there a way to configure ClipboardFusion so that it doesn't scrub html tags that contain a '@' ? This would be enough, since no 'normal' html tags can contain this character anyway. Thanks.

PS love the program, yay for never having to copy/paste through notepad again
May 6, 2010  • #1
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
There isn't a way to do this built-in to ClipboardFusion, however you can just double-click the email address in Outlook and it will show you the name in one field and the email address in another. Then you can copy only the email address, I use this trick all the time. :)
May 13, 2010  • #2
jerone's profile on WallpaperFusion.com
So ClipboardFushion 2.0 is out and contains Macros and I thought this is a good test to make one.

In Outlook when I copy a contact I get the following:

Quote:
John Doe
John Doe;
John Doe;John Doe;
John Doe[joe.doe@somedomain.com]
John Doe[joe.doe@somedomain.com];
John Doe[joe.doe@somedomain.com];John Doe[joe.doe@somedomain.com];


Using the following macro code I get the email address only:

Code

using System;
using System.Text.RegularExpressions;

public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
Regex email = new Regex(@"[[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})[\]];?", RegexOptions.IgnoreCase);
Match isMatch = email.Match(text);
MatchCollection matchList = email.Matches(text);
String rtrn = text;
if(isMatch.Success){
rtrn = String.Empty;
foreach(Match match in matchList){
rtrn += match.Groups["email"] + " ";
}
}
return rtrn;
}
}


I hope this is what you need and a good example for a macro...
May 14, 2010  • #3
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
This is excellent, and also the first Macro to be posted! :) I am putting together an area where I can post excellent Macros for people to share and use. I have a couple comments about this Macro as well:
- My Outlook addresses use [], not to wrap the email address
- If there is only a single email address there is no ; at the end, and the Macro fails to scrub it properly

Other than that, it works perfectly. Thanks!
May 14, 2010  • #4
jerone's profile on WallpaperFusion.com
Thnx Jon.
I've updated the macro with your suggestions.

I've also some suggestions for the macro window:
[list type=decimal]
  • line numbering, handy for debugging with the corresponding error log
  • sizable textbox, it's a little bit to small for my preference.
  • [/ul]
    May 14, 2010  • #5
    Jon Tackabury (BFS)'s profile on WallpaperFusion.com
    Both excellent ideas, I'll be sure to include them in the next release. Thanks!
    May 14, 2010  • #6
    jerone's profile on WallpaperFusion.com
    Great.

    ps. updated macro to support multiple emails.
    May 14, 2010  • #7
    Jon Tackabury (BFS)'s profile on WallpaperFusion.com
    Thank you for the updates, I'm hoping to have the Macro sharing area online sometime this week. :)
    May 16, 2010  • #8
    Jon Tackabury (BFS)'s profile on WallpaperFusion.com
    The Macro sharing area I talked about earlier is now online, and your Macro is the first one available:
    http://www.clipboardfusion.com/Macros/

    Thanks! :)
    May 17, 2010  • #9
    jerone's profile on WallpaperFusion.com
    Nice.
    May 18, 2010  • #10
    User Image
    wooster11
    20 discussion posts
    In regards to the size of the text box, what about a way to import a .cs file into the project. That way you can still use Visual Studio (or any other IDE) to write the code and import it in.
    May 18, 2010  • #11
    Jon Tackabury (BFS)'s profile on WallpaperFusion.com
    The only problem with this idea is that VS doesn't have the ClipboardFusion objects, and the code won't compile. In the next version (2.0.1) you will have code syntax highlighting, a re-sizable code window and line numbers to help with finding compilation errors. :)
    May 18, 2010  • #12
    Subscribe to this discussion topic using RSS
    Was this helpful?  Login to Vote(-)  Login to Vote(-)