<?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>VoiceBot RSS: SCRIPT-EDIT:  PabloMartinez's &quot;Capture Screenshot&quot; -Macro</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=ecfa730b-05f7-474f-876c-b751abd0a25e" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=ecfa730b-05f7-474f-876c-b751abd0a25e</link>
<description>VoiceBot RSS: SCRIPT-EDIT:  PabloMartinez's &quot;Capture Screenshot&quot; -Macro</description>
<lastBuildDate>Sun, 13 Sep 2026 05:04:37 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=ecfa730b-05f7-474f-876c-b751abd0a25e</generator>
<item>
<title>RE: SCRIPT-EDIT:  PabloMartinez's &quot;Capture Screenshot&quot; -Macro</title>
<link>https://www.voicebot.net/Discussions/View/script-edit-pablomartinezs-capture-screenshot-macro/?ID=ecfa730b-05f7-474f-876c-b751abd0a25e#2</link>
<pubDate>Tue, 15 Jun 2021 13:21:14 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/script-edit-pablomartinezs-capture-screenshot-macro/?ID=ecfa730b-05f7-474f-876c-b751abd0a25e#2</guid>
<category>VoiceBot</category>
<description><![CDATA[Hello,
Would you like us to add this to our script repository?
Thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hello,<br/>
<br/>
Would you like us to add this to our script repository?<br/>
<br/>
Thanks!
</div>
]]></content:encoded>
</item>
<item>
<title>SCRIPT-EDIT:  PabloMartinez's &quot;Capture Screenshot&quot; -Macro</title>
<link>https://www.voicebot.net/Discussions/View/script-edit-pablomartinezs-capture-screenshot-macro/?ID=ecfa730b-05f7-474f-876c-b751abd0a25e</link>
<pubDate>Mon, 14 Jun 2021 00:41:23 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/script-edit-pablomartinezs-capture-screenshot-macro/?ID=ecfa730b-05f7-474f-876c-b751abd0a25e</guid>
<category>VoiceBot</category>
<description><![CDATA[Deleted some lines of code to make it fullscreen only. no dialog-box.
Code
Copy
Select All
using System;&#xA;using System.Drawing;&#xA;using System.Drawing.Imaging;&#xA;using System.IO;&#xA;using System.Runtime.InteropServices;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Deleted some lines of code to make it fullscreen only. no dialog-box.<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="#code01a0992731d073e4a6a50a61542d5e9b" class="ClipboardCopyControl"><img src="https://www.voicebot.net/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('code01a0992731d073e4a6a50a61542d5e9bJs'); return false;"><img src="https://www.voicebot.net/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="code01a0992731d073e4a6a50a61542d5e9bJs" name="code01a0992731d073e4a6a50a61542d5e9bJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;using System.Drawing.Imaging;&#xA;using System.IO;&#xA;using System.Runtime.InteropServices;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        // Here you set the path for saving screenshots&#xA;        string path = (@&quot;C:\ScreenShots\&quot;);&#xA;&#xA;        // Here you may change image format (Png, Jpeg, Bmp, Tiff, Gif, Icon, Wmf, Emf, Exif)&#xA;        ImageFormat ext = ImageFormat.Png;&#xA;&#xA;        // If directory not exists call a method CreateDir&#xA;        if (!Directory.Exists(path))&#xA;        {&#xA;            Dir.CreateDir(path);&#xA;        }&#xA;        // Call a method Capture&#xA;        Capture.GetCapture(path,ext);&#xA;    }&#xA;}&#xA;&#xA;static class Dir&#xA;{&#xA;    public static void CreateDir(string path)&#xA;    {&#xA;        // Create directory if sufficient permissons.&#xA;        try&#xA;        {&#xA;            Directory.CreateDirectory(path);&#xA;            // Get only name of directory&#xA;            string foldername = Path.GetFileName(Path.GetDirectoryName(path));&#xA;            BFS.Speech.TextToSpeech(&quot;Create directory&quot; &#x2B; foldername);&#xA;        }&#xA;        // Permission exception&#xA;        catch (UnauthorizedAccessException)&#xA;        {&#xA;            BFS.Speech.TextToSpeech(&quot;Insufficient permissions. Can&#x27;t create the directory&quot;);&#xA;        }&#xA;    }&#xA;}&#xA;&#xA;static class Capture&#xA;{&#xA;    private static string name, time, extension, filename;&#xA;&#xA;    public static void GetCapture(string path, ImageFormat ext)&#xA;    {&#xA;        // Get and save fullscreen image&#xA;        Image imgFullScr = ScreenCapture.CaptureDesktop();&#xA;        GetFileName(path, ext);&#xA;        imgFullScr.Save(@filename, ext);&#xA;    }&#xA;    private static void GetFileName(string path, ImageFormat ext)&#xA;    {&#xA;        // Get handle focused window&#xA;        IntPtr hWnd = BFS.Window.GetFocusedWindow();&#xA;        // Get window name from hanle&#xA;        name = BFS.Window.GetText(hWnd);&#xA;        // Convert current time and date to string&#xA;        time = DateTime.Now.ToString(&quot;(yyyy-MM-dd@HH.mm.ss)&quot;);&#xA;        // Convert imageformat to string and to lowercase&#xA;        extension = ext.ToString().ToLower();&#xA;        // Set formatting for saving file&#xA;        filename = (path &#x2B; name &#x2B; &quot; &quot; &#x2B; time &#x2B; &quot;.&quot; &#x2B; extension);&#xA;    }&#xA;}&#xA;&#xA;static class ScreenCapture&#xA;{&#xA;    [DllImport(&quot;user32.dll&quot;)]&#xA;    private static extern IntPtr GetForegroundWindow();&#xA;    &#xA;    [DllImport(@&quot;dwmapi.dll&quot;)]&#xA;    private static extern int DwmGetWindowAttribute(IntPtr hwnd, int dwAttribute, out Rect pvAttribute, int cbAttribute);&#xA;&#xA;    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, ExactSpelling = true)]&#xA;    public static extern IntPtr GetDesktopWindow();&#xA;&#xA;    [DllImport(&quot;user32.dll&quot;)]&#xA;    private static extern IntPtr GetWindowRect(IntPtr hWnd, ref Rect rect);&#xA;&#xA;    [StructLayout(LayoutKind.Sequential)]&#xA;&#xA;    private struct Rect&#xA;    {&#xA;        public int Left;&#xA;        public int Top;&#xA;        public int Right;&#xA;        public int Bottom;&#xA;    }&#xA;    public static Image CaptureDesktop()&#xA;    {&#xA;        return CaptureWindow(GetDesktopWindow());&#xA;    }&#xA;    public static Bitmap CaptureActiveWindow()&#xA;    {&#xA;        return CaptureWindow(GetForegroundWindow());&#xA;    }&#xA;    // Capture desktop or active window&#xA;    // and return it as a bitmap&#xA;    public static Bitmap CaptureWindow(IntPtr hWnd)&#xA;    {&#xA;        var rect = new Rect();&#xA;        // If Win XP and earlier use the old way&#xA;        if (Environment.OSVersion.Version.Major &amp;lt; 6)&#xA;            GetWindowRect(hWnd, ref rect);&#xA;        // using DwmApi for border rectangle&#xA;        else&#xA;        {&#xA;            var res = -1;&#xA;            try&#xA;            {&#xA;                res = DwmGetWindowAttribute(hWnd, 9, out rect, Marshal.SizeOf(typeof(Rect)));&#xA;            }&#xA;            catch {}&#xA;            if (res &amp;lt; 0)&#xA;                GetWindowRect(hWnd, ref rect);&#xA;        }&#xA;        &#xA;        var bounds = new Rectangle(rect.Left, rect.Top, rect.Right - rect.Left, rect.Bottom - rect.Top);&#xA;        var result = new Bitmap(bounds.Width, bounds.Height);&#xA;&#xA;        using (Graphics graphics = Graphics.FromImage(result))&#xA;        {&#xA;            graphics.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);&#xA;        }&#xA;        return result;&#xA;    }&#xA;}</pre><textarea id="code01a0992731d073e4a6a50a61542d5e9b" name="code01a0992731d073e4a6a50a61542d5e9b" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>