{"id":386,"date":"2015-01-31T13:04:16","date_gmt":"2015-01-31T13:04:16","guid":{"rendered":"http:\/\/xml-buddy.com\/xmltribune\/?p=386"},"modified":"2015-09-04T13:44:51","modified_gmt":"2015-09-04T13:44:51","slug":"validation-of-all-xml-files-in-folder","status":"publish","type":"post","link":"https:\/\/www.xml-buddy.com\/xmltribune\/validation-of-all-xml-files-in-folder\/","title":{"rendered":"Call XML validator for all *.xml files in folder"},"content":{"rendered":"<p>I played around with the freeware <a title=\"AutoIt\" href=\"https:\/\/www.autoitscript.com\/site\/autoit\/\" target=\"_blank\">AutoIt<\/a> to create some scripts for XML Validator Buddy to automate certain validator tasks. As a first idea I wanted to call the XML validator for all files with *.xml as extension clicking a single button. The following steps are required:<\/p>\n<ol>\n<li>I had to fill the find field with &#8220;*.xml&#8221;.<\/li>\n<li>Send ENTER to the &#8220;Find&#8221; button.<\/li>\n<li>Call the XML validator using F8.<\/li>\n<\/ol>\n<p>The simple AutoIt script below is doing this in XML Validator Buddy:<\/p>\n<pre style=\"padding-left: 30px;\">#include &lt;Constants.au3&gt;\r\n\r\nLocal $cNewLine = chr(10) &amp; chr(13)\r\n\r\n; Prompt the user to run the script\r\nLocal $iAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL, $MB_ICONINFORMATION), \"XML ValidatorBuddy\", \"This script shows you how to quickly validate all *.xml files in the current folder.\" &amp; $cNewLine &amp; $cNewLine &amp; \"Do you want to run it?\")\r\n\r\n; If \"No\" was clicked (7) then exit the script\r\nIf $iAnswer = 7 Then\r\n  Exit\r\nEndIf\r\n\r\n; Wait for XML <a href=\"http:\/\/www.xml-buddy.com\/ValidatorBuddy.htm\" >ValidatorBuddy<\/a> become active\r\nLocal $hValBuddy = WinWaitActive(\"XML ValidatorBuddy\", \"\", 3)\r\n\r\n; filter for *.xml\r\nControlClick($hValBuddy, \"\", 142)\r\nSend(\"{CTRLDOWN}a{CTRLUP}\")\r\nSleep(1500)\r\nSend(\"{BS}\")\r\nSend(\"*\")\r\nSleep(750)\r\nSend(\".\")\r\nSleep(750)\r\nSend(\"x\")\r\nSleep(750)\r\nSend(\"m\")\r\nSleep(750)\r\nSend(\"l\")\r\nSleep(750)\r\nSend(\"{ENTER}\")\r\nSleep(2000)\r\n\r\n; select all files in File Explorer\r\nWinMenuSelectItem($hValBuddy, \"\", \"File Explorer\", \"Select all\")\r\n\r\n; and validate\r\nSend(\"{F8}\")<\/pre>\n<p>Please note that I added a lot of Sleep() statements to the code but just for demonstration purpose only.<\/p>\n<p>Then I compiled this script and added it as a\u00a0custom user\u00a0tool to XML Validator Buddy. I also checked the option to add the tool as a button to the File Explorer window:<\/p>\n<p><a href=\"http:\/\/xml-buddy.com\/xmltribune\/wp-content\/uploads\/2015\/01\/autoit_valallxml_tool.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-442\" src=\"http:\/\/xml-buddy.com\/xmltribune\/wp-content\/uploads\/2015\/01\/autoit_valallxml_tool.png\" alt=\"XML validator called by AutoIt\" width=\"736\" height=\"485\" srcset=\"https:\/\/www.xml-buddy.com\/xmltribune\/wp-content\/uploads\/2015\/01\/autoit_valallxml_tool.png 736w, https:\/\/www.xml-buddy.com\/xmltribune\/wp-content\/uploads\/2015\/01\/autoit_valallxml_tool-300x198.png 300w\" sizes=\"(max-width: 736px) 100vw, 736px\" \/><\/a><\/p>\n<p>This way I can quickly\u00a0run the XML validator\u00a0from any folder with a single click.<\/p>\n<p style=\"opacity:0.5;padding:0;margin:0;display:inline;\"><sub><a href=\"#\" onclick=\"window.open('https:\/\/www.janhvizdak.com\/rdr.me.1'); return false;\" target=\"_blank\" style=\"cursor:help;\"><b>&#187;crosslinked&#171;<\/b><\/a><\/sub><\/p>","protected":false},"excerpt":{"rendered":"<p>I played around with the freeware AutoIt to create some scripts for XML Validator Buddy to automate certain validator tasks. As a first idea I wanted to call the XML validator for all files with *.xml as extension clicking a single button. The following steps are required: I had to fill the find field with &#8220;*.xml&#8221;. Send ENTER to the&#8230; <a href=\"https:\/\/www.xml-buddy.com\/xmltribune\/validation-of-all-xml-files-in-folder\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[73,6],"tags":[75,15,76,74,71],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts\/386"}],"collection":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/comments?post=386"}],"version-history":[{"count":6,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"predecessor-version":[{"id":450,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/posts\/386\/revisions\/450"}],"wp:attachment":[{"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xml-buddy.com\/xmltribune\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}