{"id":67783,"date":"2006-03-10T14:03:00","date_gmt":"2006-03-10T14:03:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2006\/03\/10\/how-can-i-set-scriptomatic-so-that-it-automatically-outputs-to-a-text-file\/"},"modified":"2006-03-10T14:03:00","modified_gmt":"2006-03-10T14:03:00","slug":"how-can-i-set-scriptomatic-so-that-it-automatically-outputs-to-a-text-file","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/how-can-i-set-scriptomatic-so-that-it-automatically-outputs-to-a-text-file\/","title":{"rendered":"How Can I Set Scriptomatic So That It Automatically Outputs to a Text File?"},"content":{"rendered":"<p><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"> \n<P>Hey, Scripting Guy! How can I set Scriptomatic so that it automatically outputs to a text file?<BR><BR>&#8212; GD<\/P><IMG border=\"0\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" height=\"5\"><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\"><A href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><IMG class=\"farGraphic\" title=\"Script Center\" border=\"0\" alt=\"Script Center\" align=\"right\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" height=\"288\"><\/A> \n<P>Hey, GD. Well, all you have to do is &#8211; wait a second: you want to make changes to the Scriptomatic? Oh, GD: say it isn\u2019t so. Would you paint a hat on the Mona Lisa? Would you give the Venus de Milo a tattoo? Would you completely redo Frank Gehry\u2019s <A href=\"http:\/\/www.greatbuildings.com\/buildings\/Experience_Music_Project.html\" target=\"_blank\"><B>Experience Music Project building<\/B><\/A> in Seattle?<\/P>\n<P>OK, we\u2019d redo the last one, too. But, GD, the Scriptomatic is a classic, and you simply don\u2019t mess with the classics.<\/P>\n<P>Oh, what the heck: it\u2019s not <I>that<\/I> special. Here\u2019s what you need to do:<\/P>\n<P>First of all, it\u2019s a good idea to <A href=\"http:\/\/null\/technet\/scriptcenter\/tools\/scripto2.mspx\"><B>download a copy<\/B><\/A> of the Scriptomatic; thanks to our years of experience we\u2019ve learned that it\u2019s difficult to modify a script unless you actually have a copy of that script. Once you have a Scriptomatic to call your own it\u2019s probably a good idea to make a copy of it before you start messing around with the code. That makes it easier to start all over again just in case something goes horribly wrong.<\/P>\n<P>Not that the Scripting Guys would know anything about things going horribly wrong, mind you.<\/P>\n<P>Next, you need to open the Scriptomatic in Notepad or some other text editor. (As if there was any text other than Notepad!) When you\u2019ve done that, search for this line of code:<\/P><PRE class=\"codeSample\">g_strOutputFormat        = &#8220;CmdLine&#8221;\n<\/PRE>\n<P>The variable g_strOutputFormat keeps track of Scriptomatic\u2019s current output format. As you can see, the initial output format is set for the command prompt. To change that to text file output simply set the value of g_strOutputFormat to PlainText:<\/P><PRE class=\"codeSample\">g_strOutputFormat        = &#8220;PlainText&#8221;\n<\/PRE>\n<P>Technically that\u2019s all you have to do: if you save the file and start Scriptomatic it will default to outputting information to a text file. <\/P>\n<P>The only problem is that, at first glance, it won\u2019t <I>look<\/I> like it\u2019s using Plain Text as its default output format. That\u2019s because we haven\u2019t modified the default settings for the <B>Output Format<\/B> radio buttons:<\/P><IMG border=\"0\" alt=\"Scriptomatic\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/scripto1.jpg\" width=\"119\" height=\"198\"> \n<P><BR>Everything will work, but it\u2019s definitely a bit weird to have the output format seemingly set for Command Prompt yet actually going to a text file.<\/P>\n<P>So can we fix that as well? Of course we can. All we have to do is search for these two lines of code; you\u2019ll find them near the bottom of the Scriptomatic:<\/P><PRE class=\"codeSample\">&lt;tr&gt;&lt;td&gt;&lt;span style=&#8221;font-size:8pt;&#8221;&gt;Command Prompt&lt;\/span&gt;&lt;\/td&gt;&lt;td&gt;\n&lt;input type=&#8221;radio&#8221; name=&#8221;output&#8221; onClick=&#8221;SetOutputFormat(&#8216;CmdLine&#8217;)&#8221; CHECKED&gt;&lt;\/td&gt;&lt;tr&gt;\n&lt;tr&gt;&lt;td&gt;&lt;span style=&#8221;font-size:8pt;&#8221;&gt;Plain Text    &lt;\/span&gt;&lt;\/td&gt;&lt;td&gt;\n&lt;input type=&#8221;radio&#8221; name=&#8221;output&#8221; onClick=&#8221;SetOutputFormat(&#8216;PlainText&#8217;)&#8221;&gt;&lt;\/td&gt;&lt;\/tr&gt;\n<\/PRE>\n<P>Do you see the <B>CHECKED<\/B> parameter added to the Command Prompt &lt;input&gt; tag? That parameter means that we want the Command Prompt radio button to be selected by default. Of course, now we no longer want Command Prompt to be selected by default; instead, we want Plain Text selected by default. So how do we fix that? You\u2019re absolutely right: we remove the CHECKED parameter from the Command Prompt &lt;input&gt; tag and add it to the Plain Text tag instead:<\/P><PRE class=\"codeSample\">&lt;tr&gt;&lt;td&gt;&lt;span style=&#8221;font-size:8pt;&#8221;&gt;Command Prompt&lt;\/span&gt;&lt;\/td&gt;&lt;td&gt;\n&lt;input type=&#8221;radio&#8221; name=&#8221;output&#8221; onClick=&#8221;SetOutputFormat(&#8216;CmdLine&#8217;)&#8221; &gt;&lt;\/td&gt;&lt;tr&gt;\n&lt;tr&gt;&lt;td&gt;&lt;span style=&#8221;font-size:8pt;&#8221;&gt;Plain Text    &lt;\/span&gt;&lt;\/td&gt;&lt;td&gt;\n&lt;input type=&#8221;radio&#8221; name=&#8221;output&#8221; onClick=&#8221;SetOutputFormat(&#8216;PlainText&#8217;)&#8221; CHECKED&gt;&lt;\/td&gt;&lt;\/tr&gt;\n<\/PRE>\n<P>Save the file, start Scriptomatic, and you\u2019re in business:<\/P><IMG border=\"0\" alt=\"Scriptomatic\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/scripto2.jpg\" width=\"119\" height=\"198\"> \n<P><BR>Incidentally, while we don\u2019t encourage you to paint a baseball hat on the Mona Lisa (at least not the <I>actual<\/I> Mona Lisa) we definitely encourage you to modify and customize the Scriptomatic all you want. We\u2019d love to hear what you\u2019ve done with your copy of the Scriptomatic. If you\u2019ve enhanced the coding capabilities, added a new language, painted flames on the side, or otherwise souped-up the old Scriptomatic, drop us a line at <A href=\"mailto:scripter@microsoft.com\"><B>scripter@microsoft.com (in English, if possible)<\/B><\/A> and let us know what you did.<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! How can I set Scriptomatic so that it automatically outputs to a text file?&#8212; GD Hey, GD. Well, all you have to do is &#8211; wait a second: you want to make changes to the Scriptomatic? Oh, GD: say it isn\u2019t so. Would you paint a hat on the Mona Lisa? Would [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3,4,5,30],"class_list":["post-67783","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-scripting-guy","tag-scripting-techniques","tag-vbscript","tag-web-pages-and-htas"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! How can I set Scriptomatic so that it automatically outputs to a text file?&#8212; GD Hey, GD. Well, all you have to do is &#8211; wait a second: you want to make changes to the Scriptomatic? Oh, GD: say it isn\u2019t so. Would you paint a hat on the Mona Lisa? Would [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/67783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=67783"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/67783\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=67783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=67783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=67783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}