<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>ClipboardFusion RSS: How to make a Macro paste a pinned item</title>
<atom:link href="https://www.clipboardfusion.com/Discussions/RSS/?TopicID=00de6073-c0f1-4346-ac70-98c979d3d836" rel="self" type="application/rss+xml" />
<link>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=00de6073-c0f1-4346-ac70-98c979d3d836</link>
<description>ClipboardFusion RSS: How to make a Macro paste a pinned item</description>
<lastBuildDate>Tue, 16 Jun 2026 01:20:56 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=00de6073-c0f1-4346-ac70-98c979d3d836</generator>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#11</link>
<pubDate>Wed, 25 Sep 2019 13:59:20 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#11</guid>
<category>ClipboardFusion</category>
<description><![CDATA[I was able to put something together that should work for you. I've modified Keith's code a little to check for the weekend after each day, so the Macro should work if you run it on a weekend, or if the time you want to add spans for more than one week.
I hope this works for you!
Code
Copy
Se...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I was able to put something together that should work for you. I've modified Keith's code a little to check for the weekend after each day, so the Macro should work if you run it on a weekend, or if the time you want to add spans for more than one week. <br/>
<br/>
I hope this works for you!<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019ece04697676dbb0e23e64e22769ec" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019ece04697676dbb0e23e64e22769ecJs'); return false;"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019ece04697676dbb0e23e64e22769ecJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Collections.Generic;

public static class ClipboardFusionHelper
{
    public static string ProcessText(string text)
    {
        // Set the days to add and get the current date/time
        int daysToAdd = 7;
        
        // Get the date
        DateTime date = DateTime.Now;
        
        // Fix the date in case it's a weekend
        if (date.DayOfWeek == DayOfWeek.Saturday)
            date = date.AddDays(2);
        else if (date.DayOfWeek == DayOfWeek.Sunday)
            date = date.AddDays(1);
        
        // Add the days one at a time, and check for a weekend after each time
        for(int i = 0; i &lt; daysToAdd; i++)
        {
            // Add one day
            date = date.AddDays(1);
        
            // Check if the new date is a Saturday or Sunday, if so, add some more days
            if (date.DayOfWeek == DayOfWeek.Saturday)
                date = date.AddDays(2);
            else if (date.DayOfWeek == DayOfWeek.Sunday)
                date = date.AddDays(1);
        }
        
        // Convert the date/time to text
        text = date.ToString("dd.MM.yyyy hh.mm.ss");
        
        // Paste and return the text to the clipboard
        BFS.Clipboard.PasteText(text);
        return text;
    }
}</pre><textarea id="code019ece04697676dbb0e23e64e22769ec" name="code019ece04697676dbb0e23e64e22769ec" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#10</link>
<pubDate>Fri, 15 Mar 2019 13:44:51 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#10</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Since it's friday, I've had a chance to try out your code, and I realized a limitation.
If I want to add 3 working days, it only adds 3 days, and sets monday, instead of seeing that its been a weekend, and adding another 2 days.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Since it's friday, I've had a chance to try out your code, and I realized a limitation.<br/>
If I want to add 3 working days, it only adds 3 days, and sets monday, instead of seeing that its been a weekend, and adding another 2 days.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#9</link>
<pubDate>Tue, 12 Mar 2019 09:44:56 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#9</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Maybe not, but it looks like it should work for me. Thanks a bunch.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Maybe not, but it looks like it should work for me. Thanks a bunch. <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-laugh-squint.light.svg" alt=":D" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":D" HelpButtonDataAlign="BelowMiddle" />
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#8</link>
<pubDate>Mon, 11 Mar 2019 18:56:17 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#8</guid>
<category>ClipboardFusion</category>
<description><![CDATA[I'm not sure if this is the best way to do it, but it should work
Code
Copy
Select All
using System;
using System.Collections.Generic;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
// Set the days to add and get the current date/time
int da...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I'm not sure if this is the best way to do it, but it should work <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019ece0469897157b013ed1b56e8bb48" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019ece0469897157b013ed1b56e8bb48Js'); return false;"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019ece0469897157b013ed1b56e8bb48Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Collections.Generic;

public static class ClipboardFusionHelper
{
    public static string ProcessText(string text)
    {
        // Set the days to add and get the current date/time
        int daysToAdd = 7;
        DateTime currentDateTime = DateTime.Now;
        
        // Set the potential new date/time
        DateTime newDate = currentDateTime.AddDays(daysToAdd);
        
        // Check if the new date is a Saturday or Sunday, if so, add some more days
        if (newDate.DayOfWeek == DayOfWeek.Saturday)
            newDate = newDate.AddDays(2);
        else if (newDate.DayOfWeek == DayOfWeek.Sunday)
            newDate = newDate.AddDays(1);
        
        // Convert the date/time to text
        text = newDate.ToString("dd.MM.yyyy hh.mm.ss");
        
        // Paste and return the text to the clipboard
        BFS.Clipboard.PasteText(text);
        return text;
    }
}</pre><textarea id="code019ece0469897157b013ed1b56e8bb48" name="code019ece0469897157b013ed1b56e8bb48" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#7</link>
<pubDate>Fri, 08 Mar 2019 09:19:50 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#7</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Thanks again. This has been very helpfull. I want to make it skip weekends. Possibly holidays, I see some commands on stack overflow for AddBusinessDays, but that doesnt follow the syntax in use here. Is there a way to do it in the code you already made for me?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks again. This has been very helpfull. I want to make it skip weekends. Possibly holidays, I see some commands on stack overflow for AddBusinessDays, but that doesnt follow the syntax in use here. Is there a way to do it in the code you already made for me?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#6</link>
<pubDate>Thu, 17 Jan 2019 19:16:14 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#6</guid>
<category>ClipboardFusion</category>
<description><![CDATA[No worries, glad we could help!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
No worries, glad we could help!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#5</link>
<pubDate>Thu, 17 Jan 2019 09:34:44 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#5</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Nice. This works. Thank you for your help.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Nice. This works. Thank you for your help.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#4</link>
<pubDate>Wed, 16 Jan 2019 19:57:15 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#4</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Ok, try this out:
Code
Copy
Select All
using System;
using System.Collections.Generic;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
int daysToAdd = 4;
DateTime currentDateTime = DateTime.Now;
text = currentDateTime.AddDays(daysToAdd).ToSt...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, try this out:<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019ece04699b71bab5ab924d1488c5c0" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019ece04699b71bab5ab924d1488c5c0Js'); return false;"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019ece04699b71bab5ab924d1488c5c0Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Collections.Generic;

public static class ClipboardFusionHelper
{
    public static string ProcessText(string text)
    {
        int daysToAdd = 4;
        DateTime currentDateTime = DateTime.Now;
        
        text = currentDateTime.AddDays(daysToAdd).ToString("dd.MM.yyyy hh.mm.ss");
        BFS.Clipboard.PasteText(text);
        return text;
    }
}</pre><textarea id="code019ece04699b71bab5ab924d1488c5c0" name="code019ece04699b71bab5ab924d1488c5c0" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#3</link>
<pubDate>Wed, 16 Jan 2019 19:31:33 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#3</guid>
<category>ClipboardFusion</category>
<description><![CDATA[dd.mm.yy and if possible hh:mm:ss but not essential.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
dd.mm.yy and if possible hh:mm:ss but not essential.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#2</link>
<pubDate>Wed, 16 Jan 2019 19:25:14 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836#2</guid>
<category>ClipboardFusion</category>
<description><![CDATA[To get the pinned text in the first slot you need to use index 0, and you have to call BFS.Clipboard.SetText, like so:
BFS.Clipboard.SetText(BFS.ClipboardFusion.GetLocalPinnedText(0));
You can get the date in a macro as well. What format do you need the date to be in?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
To get the pinned text in the first slot you need to use index 0, and you have to call BFS.Clipboard.SetText, like so:<br/>
<br/>
<div class="Inline"><pre>BFS.Clipboard.SetText(BFS.ClipboardFusion.GetLocalPinnedText(0));</pre></div><br/>
<br/>
You can get the date in a macro as well. What format do you need the date to be in?
</div>
]]></content:encoded>
</item>
<item>
<title>How to make a Macro paste a pinned item</title>
<link>https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836</link>
<pubDate>Wed, 16 Jan 2019 09:41:04 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/how-to-make-a-macro-paste-a-pinned-item/?ID=00de6073-c0f1-4346-ac70-98c979d3d836</guid>
<category>ClipboardFusion</category>
<description><![CDATA[I am in the process of setting up macros that navigate between text boxes.
Most of them I can use the BFS.Clipboard.PasteText for, but I have 1 field that changes, and it's a date/time field.
So I decided to set up a pinned item in the #1 slot, with the date and time I want to use every time th...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I am in the process of setting up macros that navigate between text boxes.<br/>
Most of them I can use the BFS.Clipboard.PasteText for, but I have 1 field that changes, and it's a date/time field.<br/>
So I decided to set up a pinned item in the #1 slot, with the date and time I want to use every time the macro is run.<br/>
So if the date changes, I just change the pinned item, not the macro.<br/>
<br/>
I assumed I could use one of the BFS.ClipboardFusion statements to do this, but if I use BFS.ClipboardFusion.GetLocalPinnedText(1); my current clipboard item is not updated. When I try to paste, it just pastes what ever I had copied before I ran the macro.<br/>
<br/>
How can I make this work?<br/>
<br/>
Alternatively, is there a way where I can just get the date, and set it to say 4 days from now, and paste that?
</div>
]]></content:encoded>
</item>
</channel>
</rss>