Convert html to Gui

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hracer75
Posts: 19
Joined: 19 Dec 2016, 23:52

Convert html to Gui

11 Jul 2017, 15:54

Can someone convert this to a gui? I want to have the copy button both copy to clipboard and send to a text log file. Not sure if this is possible to do so. I use the html for my notes, but wondering if it would be possible to change this so it will do both. Thx for the help. :D

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>NoteMakr vx.x</title>

 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script language="javascript"> 
//Modded BY MIKE., 4/12/20116
//GLOBAL VARIABLES
var cb = "";
var test = "";
var temp = "";
var firstrun = true;
var Code = "tam";
//STANDARD COPY FUNCTIONS//
function Copy_onclick() {
//*** field1 ***//
if(Trim(document.getElementById("gen_field1").value)=='') {
document.getElementById("row_field1").style.backgroundColor = '#FF0000';
return;
} else {
document.getElementById("row_field1").style.backgroundColor = '#FFFFFF';
}
//*** field2 ***//
if(Trim(document.getElementById("gen_field2").value)=='') {
document.getElementById("row_field2").style.backgroundColor = '#FF0000';
return;
} else {
document.getElementById("row_field2").style.backgroundColor = '#FFFFFF';
}
//*** field3 ***//
if(Trim(document.getElementById("gen_field3").value)=='') {
document.getElementById("row_field3").style.backgroundColor = '#FF0000';
return;
} else {
document.getElementById("row_field3").style.backgroundColor = '#FFFFFF';
}
//*** field4 ***//
if(Trim(document.getElementById("gen_field4").value)=='') {
document.getElementById("row_field4").style.backgroundColor = '#FF0000';
return;
} else {
document.getElementById("row_field4").style.backgroundColor = '#FFFFFF';
}
//*** field5 ***//
if(Trim(document.getElementById("gen_field5").value)=='') {
document.getElementById("row_field5").style.backgroundColor = '#FF0000';
return;
} else {
document.getElementById("row_field5").style.backgroundColor = '#FFFFFF';
}
//*** field8 ***//
if(Trim(document.getElementById("gen_field8").value)=='') {
document.getElementById("row_field8").style.backgroundColor = '#FF0000';
return;
} else {
document.getElementById("row_field8").style.backgroundColor = '#FFFFFF';
}
//COPY TO CLIPBOARD FUNCTION//
window.clipboardData.clearData();
cb="";
//*** CUSTOMER INFORMATION ***//

//HACK TO CHANGE "CX" OR "CUST" TO WHAT IS FROM THE "CALLER NAME:" FIELD//
temp = document.getElementById("gen_field8").value;'-'
temp = temp.replace(/cx/gi,'' + document.getElementById("gen_field1").value + '');
cb+=AddLine(document.getElementById("gen_field1").value,'-field1: ','\r\n');
cb+=AddLine(document.getElementById("gen_field2").value,'-field2: ','\r\n');
cb+=AddLine(document.getElementById("gen_field3").value,'-field3: ','\r\n');
cb+=AddLine(document.getElementById("gen_field4").value,'-field4: ','\r\n');
cb+=AddLine(document.getElementById("gen_field5").value,'-field5: ','\r\n');
cb+=AddLine(temp,'-field8: ','\r*******************\n\n');
window.clipboardData.setData("Text",cb);
}
function AddLine(ourvalue,pre,post) {
if(Trim(ourvalue)!='') {
return pre+ourvalue+post;
} else {
return '';
}
}
function Trim(totrim) {
totrim = totrim.replace(/^\s*|\s*$/g,"");
return totrim;
}
function Size_Comments(){
//CHANGE THE SIZE OF THE COMMENTS BOX BASED ON THE CHARACTERS IN IT, DIRTY HACK MIGHT NO WORK WELL, BUT GIVING IT A SHOT.
var txtsize;
var txt;
var irows;
txt = document.getElementById("gen_field8").value;
txtsize = String(txt).length;
irows = parseInt(txtsize/28);
irows += 8;
}
//RESET FUNCTIONS//
function Form_Reset() {
//*** CHECK TO SEE IF THEY REALLY WANT TO RESET ***//
if(!firstrun) {
answer = confirm("This will reset all information fields.");
if(answer!=true) { return; }
init();
}
document.getElementById("gen_field1").value = '';
document.getElementById("gen_field2").value = '';
document.getElementById("gen_field3").value = '';
document.getElementById("gen_field4").value = '';
document.getElementById("gen_field5").value = '';
//*** ADDED FOR AUTOSCALE OF COMMENTS ***//
document.getElementById("gen_field8").value = '';
//*** ADDED FOR AUTOSCALE OF COMMENTS ***//
document.getElementById("gen_field8").rows = 8;
document.getElementById("row_field1").style.backgroundColor = '#FFFFFF';
document.getElementById("table_main").style.backgroundColor = '#FFFFFF';
document.getElementById("row_field2").style.backgroundColor = '#FFFFFF';
document.getElementById("row_field3").style.backgroundColor = '#FFFFFF';
document.getElementById("row_field5").style.backgroundColor = '#FFFFFF';
document.getElementById("row_field4").
style.backgroundColor = '#FFFFFF';
}
</script>
 
<script language="JavaScript" type="text/javascript"> 
//STOPWATCH//
<!-- Copyright 2001, Sandeep Gangadharan -->
<!-- For more free scripts go to http://www.sivamdesign.com/scripts/ -->
<!--
var sec = 0;
var min = 0;
var hour = 0;
function stopwatch(text) {
sec++;
if (sec == 60) {
sec = 0;
min = min + 1; }
else {
min = min; }
if (min == 60) {
min = 0; hour += 1; }
if (sec<=9) { sec = "0" + sec; }
document.clock.stwa.value = ((hour<=9) ? "0"+hour : hour) + " : " + ((min<=9) ? "0" + min : min) + " : " + sec;
if (text == "Start") { document.clock.theButton.value = "Stop "; }
if (text == "Stop ") { document.clock.theButton.value = "Start"; }
if (document.clock.theButton.value == "Start") {
window.clearTimeout(SD);
return true; }
SD=window.setTimeout("stopwatch();", 1000);
}
function resetIt() {
sec = -1;
min = 0;
hour = 0;
if (document.clock.theButton.value == "Stop ") {
document.clock.theButton.value = "Start"; }
window.clearTimeout(SD);
}
// -->
</script>
<meta content="MSHTML 6.00.2900.5848" name="GENERATOR"></head><body>
<table style="width: 415px; height: 440px; font-family: Arial;">
<tbody>
<tr>
<td valign="top">
<table id="table_main" valign="top" style="width: 442px; height: 560px;" border="0" cellpadding="1" cellspacing="0">
<tbody>
<tr style="font-weight: bold; color: white;">
<td style="vertical-align: top; text-align: center; background-color: rgb(34, 34, 34);" colspan="2"><big>NoteMakr
vx.x</big>
</td>
</tr>
<tr style="font-weight: bold; color: red;">
<td style="vertical-align: top; text-align: center; background-color: rgb(34, 34, 34);" colspan="2"><big>Add your text here</big>
</td>
</tr>
<form></form>
<tr id="row_field1">
<td style="font-weight: bold;" align="right"><small>field1:</small></td>
<td><input id="gen_field1" size="40" name="field1"></td>
</tr>
<tr id="row_field2">
<td style="font-weight: bold;" align="right"><small>field2:</small></td>
<td><input id="gen_field2" size="40" name="field2"></td>
</tr>
<tr id="row_field3">
<td style="font-weight: bold;" align="right"><small>field3:</small></td>
<td><input id="gen_field3" size="40" name="field3"></td>
</tr>
<tr id="row_field4">
<td style="font-weight: bold;" align="right"><small>field4:</small></td>
<td><input id="gen_field4" size="40" name="field4"></td>
</tr>
<tr id="row_field5">
<td style="font-weight: bold;" align="right"><small>field5:</small></td>
<td><input id="gen_field5" size="40" name="field5"></td>
</tr>
<tr id="row_field8">
<td style="font-weight: bold;" align="right"><small>field8:</small></td>
<td><textarea onkeypress="Size_Comments()" id="gen_field8" name="field8" rows="8" cols="37"></textarea></td>
</tr>
<tr>
<td colspan="2" style="text-align: center; background-color: rgb(34, 34, 34);"><input language="javascript" id="CopyToClipboard" onclick="Copy_onclick()" value="     Copy     " type="button">
&nbsp; &nbsp; &nbsp;<input onclick="Form_Reset()" value="Reset" type="button"></td>
</tr>
<tr style="color: rgb(115, 0, 230); background-color: rgb(204, 204, 204);">
<td style="background-color: rgb(34, 34, 34);" colspan="1">
<div style="background-color: rgb(34, 34, 34);" align="right"><i>
</i><table style="background-color: rgb(255, 255, 153); width: 140px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellspacing="0">
  <tbody><tr style="color: white;">
     <td style="text-align: center; background-color: rgb(51, 51, 51);">
       <font size="2">
       <b>STOPWATCH</b></font>
     </td>
  </tr>
  <tr>
     <td style="text-align: center; background-color: rgb(34, 34, 34);">
       <form style="background-color: rgb(177, 177, 177);" name="clock">
       <input size="12" name="stwa" value="00 : 00 : 00" style="text-align: center;" type="text"><br>
       <input name="theButton" onclick="stopwatch(this.value);" value="Start" type="button">
       <input value="Reset" onclick="resetIt();reset();" type="button">
       </form>
     </td>
  </tr>     
</tbody></table><!-- GOOGLE ELEMENT -->
<div class="Google">
<form style="background-color: rgb(34, 34, 34);" action="http://www.google.com/search" name="search" method="get" target="_blank"> <big style="color: rgb(51, 51, 255);"><span style="font-weight: bold;"></span></big><input class="search" maxlength="2048" name="q" onblur="if (value=='') {value='Google Search'}" onfocus="if (value=='Google Search') {value=''}" style="" tabindex="6" value="Google Search" type="text">
</form>
</div>
<small style="color: rgb(127, 0, 255);"><i style="font-weight: bold;">vx.x - 1/1/1111<br></i><i style="font-weight: bold;"><big><big><font size="-2"><big>Modded
by Mike</big></font></big></big></i></small></div>
</td>
<td style="text-align: center; background-color: rgb(153, 0, 0);"><small><span style="font-weight: bold; color: black;">Breaks/Lunches:<br></span></small><textarea onkeypress="Size_Comments()" id="gen_breaks" name="breaks" rows="10" cols="32"></textarea></td>
</tr>
</tbody>
</table>
<br>
</td>
</tr>
</tbody>
</table></body></html>

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: hiahkforum, NullRefEx, XMCQCX and 123 guests