 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Procyan Guest
|
Posted: Wed Sep 03, 2008 10:03 am Post subject: ControlFocus |
|
|
I have been using AutoHotKey for a couple months to help automate some of the tedious repetitive tasks that I need to do at the office. My macro is simply copy and paste commands with a tab to move me from line to line. It has been working fine for me for 2 months. When I finally decided to share it with a co-worker it messes up every time on his computer. I tried to slow it down with some sleep commands between the tabs but that still doesn't work. So I have decided to try to use the "ControlFocus" command. On the webpage I load it has 100 combo boxes. The first combo box is called "Select1" through "Select100" This is one of the Macros I have been using.
| Code: | #1::
InputBox, Lines, How many lines?
Loop %Lines%
{
Send U
Sleep 25
Send {Tab}
Sleep 75
} |
The U corresponds to the ComboBox on the webpage to the selection I need to make. I don't all ways have 100 lines to do so that’s why I have an InputBox.
Would it be easier to try to make this work correctly or should I write new code?
I'm sure it can be done more efficiently, but I don't know how.
Any help would be appreciated. |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Wed Sep 03, 2008 11:38 am Post subject: |
|
|
| Quote: | | or should I write new code? | Yes! I guess reliabillity is something you've to expect within your working environment.
Can you provide the source code of the form you (your colleague) has to fill? |
|
| Back to top |
|
 |
Procyan Guest
|
Posted: Wed Sep 03, 2008 12:01 pm Post subject: |
|
|
| Code: | <html>
<head>
<title>ARMT - Field Reset Disposition Provider (ASC): LSE Level</title>
<link href="/fleetanalyzer_reset/fleetmanager/reset/styles/style_base.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.selected_row {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
color: #000000;
background-color: #FFFFCC;
padding: 3px;
border: none;
border-right: 1px solid #cccccc;
}
.selected_row_left {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
color: #000000;
background-color: #FFFFCC;
padding: 3px;
border: none;
border-right: 1px solid #cccccc;
border-left: 1px solid #cccccc;
}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#cccccc">
<div id="title_bar_base">
<img id="armt_logo" src="/fleetanalyzer_reset/fleetmanager/reset/images/armt_logo.jpg" alt="ARMT" />
<h1 id="app_title">ARMT - Field Reset Disposition Provider (ASC): LSE Level</h1>
<img id="logsa_logo" src="/fleetanalyzer_reset/fleetmanager/reset/images/logsa_title_bar.jpg" alt="ARMT" />
</div>
<div id="default_tool_bar">
<a href="excel_gen.cfm?page=1&from=1&thru=100&bct=&uic=&sos=&lin=A33020&niin=&plan_id=" target="_blank" class="tool_bar" style="border-right: 1px solid #999999;"
>Export to Excel</a>
<a href="lse_filter.cfm" target="_self" class="tool_bar"
>Return to Filter</a>
<span id="default_tools">
<a href="https://weblog.logsa.army.mil/log911/index.cfm" target="_blank" class="tool_bar">Log911</a>
<a href="https://liw.logsa.army.mil/index.cfm?fuseAction=support.userFeedback" target="_blank" class="tool_bar">LIW Feedback</a>
<a href="https://liw.logsa.army.mil/help/general/liw_webhelp.htm" target="_blank" class="tool_bar">WebHelp</a>
</span>
</div>
<script language="javascript">
<!--
// Used to check that there was a value selected from the drop-down before submitting.
function checkSelect(filterType) {
var currentFilter = document.getElementById(filterType);
var filterSelect = currentFilter.selectedIndex;
if (filterSelect == 0)
{
// alert('You must select a value to filter before continuing. Please select a Filter value.');
return false;
}
else
{
return true;
}
}
function clearFullForm() {
// alert('BCT: ' + document.getElementById('bct').selectedIndex);
document.getElementById('bct').selectedIndex = 0;
// alert('UIC: ' + document.getElementById('UIC').selectedIndex);
document.getElementById('UIC').selectedIndex = 0;
// alert('SOS: ' + document.getElementById('SOS').selectedIndex);
document.getElementById('SOS').selectedIndex = 0;
// alert('LIN: ' + document.getElementById('LIN').selectedIndex);
document.getElementById('LIN').selectedIndex = 0;
// alert('NIIN: ' + document.getElementById('NIIN').selectedIndex);
document.getElementById('NIIN').selectedIndex = 0;
// alert('PLAN_ID: ' + document.getElementById('PLAN_ID').selectedIndex);
document.getElementById('PLAN_ID').selectedIndex = 0;
}
function selectStorage(filter,action,selectNum)
{
// 0 = bct
// 1 = uic
// 2 = sos
// 3 = lin
// 4 = niin
// 5 = plan_id
var selectArray = new Array();
if(action == 'save')
{
if(filter = 'bct')
{
selectArray[0] = selectNum;
}
else if(filter = 'uic')
{
selectArray[1] = selectNum;
}
else if(filter = 'sos')
{
selectArray[2] = selectNum;
}
else if(filter = 'lin')
{
selectArray[3] = selectNum;
}
else if(filter = 'niin')
{
selectArray[4] = selectNum;
}
else if(filter = 'plan_id')
{
selectArray[5] = selectNum;
}
}
else if (action == 'set')
{
document.getElementById('bct').selectedIndex = selectArray[0];
document.getElementById('UIC').selectedIndex = selectArray[1];
document.getElementById('SOS').selectedIndex = selectArray[2];
document.getElementById('LIN').selectedIndex = selectArray[3];
document.getElementById('NIIN').selectedIndex = selectArray[4];
document.getElementById('PLAN_ID').selectedIndex = selectArray[5];
}
}
function checkComp(filterType)
{
var compCodeBase = document.getElementById('comp_cd')
var compCodeSelected = compCodeBase.selectedIndex;
if (compCodeSelected === 0)
{
rerunFilter(1,'Active',filterType);
}
else
{
rerunFilter(3,'Reserve',filterType);
}
document.getElementById('submitAll').disabled = false;
}
function rerunFilter(compCode,compCodeDesc,filterType)
{
document.getElementById('comp_cd').disabled = true;
document.getElementById('bct').disabled = true;
document.getElementById('uic').disabled = true;
document.getElementById('sos').disabled = true;
document.getElementById('lin').disabled = true;
document.getElementById('niin').disabled = true;
document.getElementById('plan_id').disabled = true;
document.getElementById('submitAll').style.visibility = 'hidden';
document.getElementById('reset').style.visibility = 'hidden';
document.getElementById('loadingBar').style.visibility = 'visible';
if (filterType === 'mainFilter')
{
location.href = 'lse_filter.cfm?comp_cd_check='+ compCode;
}
else
{
var uicBase = document.getElementById('uic')
var uicSelected = uicBase.selectedIndex;
var uicValue = uicBase.options[uicSelected].value;
var bctBase = document.getElementById('bct')
var bctSelected = bctBase.selectedIndex;
var bctValue = bctBase.options[bctSelected].value;
var sosBase = document.getElementById('sos')
var sosSelected = sosBase.selectedIndex;
var sosValue = sosBase.options[sosSelected].value;
var linBase = document.getElementById('lin')
var linSelected = linBase.selectedIndex;
var linValue = linBase.options[linSelected].value;
var niinBase = document.getElementById('niin')
var niinSelected = niinBase.selectedIndex;
var niinValue = niinBase.options[niinSelected].value;
var plan_idBase = document.getElementById('plan_id')
var plan_idSelected = plan_idBase.selectedIndex;
var plan_idValue = plan_idBase.options[plan_idSelected].value;
location.href = 'process_act.cfm?comp_cd_check=' + compCode + '&uic=' + uicValue + '&bct=' + bctValue + '&sos=' + sosValue + '&lin=' + linValue + '&niin=' + niinValue + '&plan_id=' + plan_idValue;
}
}
-->
</script>
<script language="javascript">
<!--
function checkSelections()
{
var numUIC = 48
var numChecks = 0;
if (typeof checked == "undefined")
{
for (x = 1; x <= numUIC; x++)
{
var rowCheck = document.getElementById('UIC_' + x).checked
if (rowCheck == 1)
{
numChecks++;
}
}
if (numChecks == 0)
{
alert('Please choose at least one (1) Unit to provide disposition.');
document.getElementById('UIC1').focus;
return false;
}
for (z = 1; z <= numUIC; z++)
{
var rowCheckDODAAC = document.getElementById('ship_to_DODAAC_' + z).value
if (rowCheckDODAAC == "")
{
numChecksDODAAC++;
}
}
if (numChecksDODAAC == 0)
{
alert('Please enter a Ship To DODAAC above.');
document.getElementById('UIC1').focus;
return false;
}
checked = "yes";
}
else
{
return true;
}
}
var the_field;
// Functions to create field elements
function createField(fieldName,currentRow,fieldValue)
{
newField = document.createElement('INPUT');
newField.setAttribute('type', 'hidden');
var fieldRow = fieldName + currentRow;
newField.setAttribute('name', fieldName + '_' + currentRow);
newField.setAttribute('value', fieldValue);
document.getElementById('fieldItems').appendChild(newField);
// alert(fieldName + ': ' + newField.value);
}
function createExistingData(uicValue,niinValue,snValue,rowNum)
{
createField('uic',rowNum,uicValue);
alert("UIC " + rowNum + " Created");
createField('niin',rowNum,niinValue);
alert("NIIN " + rowNum + " Created");
createField('serial_num',rowNum,snValue);
alert("Serial Number " + rowNum + " Created");
}
function displayDODAAC(rowName,rowNum,uic,lin,lst_updt,fsc,niin,nomen_35,model,sos,serial_num,pbic,ari_flag,proj_cd,funded,days_waiting,parent_uic)
{
var rowID = document.getElementById('select' + rowNum);
var rowSelected = rowID.selectedIndex;
var rowOption = rowID[rowSelected].value;
var ship_to_dodaac = rowOption;
/* Debug
alert('Row ID: ' + rowID);
alert('Row Selected: ' + rowSelected);
alert('Row Option: ' + rowOption);
*/
createField('uic',rowNum,uic)
createField('niin',rowNum,niin)
createField('serial_num',rowNum,serial_num)
/*
createField('lin',rowNum,lin)
createField('lst_updt',rowNum,lst_updt)
createField('fsc',rowNum,fsc)
createField('nomen_35',rowNum,nomen_35)
createField('model',rowNum,model)
createField('sos',rowNum,sos)
createField('pbic',rowNum,pbic)
createField('ari_flag',rowNum,ari_flag)
createField('proj_cd',rowNum,proj_cd)
createField('funded',rowNum,funded)
createField('days_waiting',rowNum,days_waiting)
createField('parent_uic',rowNum,parent_uic)
*/
var shiptoDODAACtext = document.getElementById('ship_to_DODAAC_' + rowNum);
shiptoDODAACtext.value = rowOption;
shiptoDODAACtext.disabled = false
var remarksInput = document.getElementById('PROV_REMARKS_' + rowNum);
remarksInput.disabled = false;
remarksInput.focus();
}
function checkRemarks(rowNum)
{
var remarkField = document.getElementById('PROV_REMARKS_' + rowNum);
var RepLoc = document.getElementById('ship_to_DODAAC_' + rowNum);
var RepLocDropdown = document.getElementById('select' + rowNum);
if (remarkField.value == "" && (RepLoc.value != "" || RepLoc.value != " "))
{
alert('If disposition is Provided, a remark is required.');
RepLocDropdown.focus();
return false;
}
else if (remarkField.value == "" && (RepLoc.value == "" || RepLoc.value == " "))
{
alert('If disposition is Provided, a remark is required.');
RepLoc.focus();
return false;
}
else
{
return true;
}
}
function checkRepLoc(numRows)
{
// Debug
/*
alert('Number of Rows: ' + numRows);
var testRepLoc = document.getElementById('ship_to_DODAAC_7');
alert('Ship-to-DODAAC 7: ' + testRepLoc.value);
*/
for (repCheck = 1; repCheck <= numRows; repCheck++)
{
var remarksField = document.getElementById('PROV_REMARKS_' + repCheck);
var RepLoc = document.getElementById('ship_to_DODAAC_' + repCheck);
if(remarksField.disabled == true)
{
// Thar be disabledness!
// alert('The Remarks Field is Disabled!!!... continue.');
}
else
{
// alert('RemarksField: ' + remarksField.disabled + ' | Repair Location Value: >>' + RepLoc.value + '<<');
// return false;
if(remarksField.disabled == false && (RepLoc.value == "" || RepLoc.value == " "))
{
alert('A Ship To DODAAC is required.');
RepLoc.focus();
return false;
}
}
}
/**/
}
-->
</script>
<form action="process_dispo.cfm" method="post" name="fldForm" id="fldForm" onSubmit="return checkRepLoc('100');">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<th colspan="15" class="table_header table_header_left" style="text-align: left; height: 35px;">
<h1>Items awaiting Disposition for LSE(s): W0DAK7, W0DA89, W0DAK6, W0DAK8, W0DAN4, W0DA84, W0DA86, W0DA87, W0DA88, W0DA85</h1>
Number of Records: 48
<div style="font-size: 10px;">
Page: 1 (Records: 1 - 100 of 48)
<br /><br />
-
<span style="font-size: 12px; color: #333333; background-color: #CCFFCC; padding: 3px;">
1</span> -
</div>
</th>
</tr>
<tr>
<th class="table_header table_header_left">Row</th>
<th class="table_header">Parent UIC</th>
<th class="table_header">UIC</th>
<th class="table_header">LIN</th>
<th class="table_header">NIIN</th>
<th class="table_header">Nomen</th>
<th class="table_header">SOS</th>
<th class="table_header">Serial Num</th>
<th class="table_header">PBIC</th>
<th class="table_header">ARI Flag</th>
<th class="table_header">Installation/UIC</th>
<th class="table_header">Ship To DODAAC</th>
<th class="table_header">Remarks</th>
<th class="table_header">Days Waiting</th>
</tr>
<tr>
<td class="even" nowrap align="center">1 </td>
<td class="even" nowrap>WAPCAA </td>
<td class="even">WAPCAA </td>
<td class="even">A33020 </td>
<td class="even">014386963 </td>
<td class="even" nowrap>ALARM CHE AG AUTO M22 </td>
<td class="even">A12 </td>
<td class="even">Y14-M-15364 </td>
<td class="even" align="center">8 </td>
<td class="even" align="center">N </td>
<td class="even" valign="middle">
<select name="select1" id="select1" onChange="displayDODAAC('rep_loc1','1','WAPCAA','A33020','09-03-2008','6665','014386963','ALARM CHE AG AUTO M22','','A12','Y14-M-15364','8','N','9GQ','','17','WAPCAA')">
<option value=""> </option>
<option id="WK9E2N" value="WK9E2N">CP EDERLE (WK9E2N)</option>
<option id="W800TM" value="W800TM">KAISERSLA (W800TM)</option>
<option id="W803CR" value="W803CR">KAISERSLA (W803CR)</option>
<option id="W804T6" value="W804T6">KAISERSLA (W804T6)</option>
<option id="W80N53" value="W80N53">KAISERSLA (W80N53)</option>
<option id="W80N6Y" value="W80N6Y">KAISERSLA (W80N6Y)</option>
<option id="W80Q7B" value="W80Q7B">KAISERSLA (W80Q7B)</option>
<option id="W81G2F" value="W81G2F">KAISERSLA (W81G2F)</option>
<option id="W9032N" value="W9032N">KAISERSLA (W9032N)</option>
<option id="W91LEP" value="W91LEP">KAISERSLA (W91LEP)</option>
<option id="WK4EYJ" value="WK4EYJ">KAISERSLA (WK4EYJ)</option>
<option id="WK4F10" value="WK4F10">KAISERSLA (WK4F10)</option>
<option id="WK4FZN" value="WK4FZN">KAISERSLA (WK4FZN)</option>
<option id="WK4GCW" value="WK4GCW">KAISERSLA (WK4GCW)</option>
<option id="WK4GCX" value="WK4GCX">KAISERSLA (WK4GCX)</option>
<option id="WK4GFB" value="WK4GFB">KAISERSLA (WK4GFB)</option>
<option id="WK4GGD" value="WK4GGD">KAISERSLA (WK4GGD)</option>
<option id="WK4S0Z" value="WK4S0Z">WIESBADEN (WK4S0Z)</option>
<option id="depot" value="">DEPOT</option>
<option id="cont" value="">CONTRACTOR</option>
<option id="unit" value="">UNIT</option>
</select>
</td>
<td class="even" valign="middle">
<div id="shipToDodaac1"></div>
<input type="Text" name="ship_to_DODAAC_1" size="15" maxlength="6" disabled="disabled">
</td>
<td class="even" valign="middle">
<div id="provRemarks1"></div>
<input type="Text" id="PROV_REMARKS_1" name="PROV_REMARKS_1" size="50" maxlength="512" disabled="disabled" />
</td>
<td class="even" nowrap align="center">17 </td>
</tr>
<div id="fieldItems"></div>
<tr>
<td class="odd" nowrap align="center">2 </td>
<td class="odd" nowrap>WAPCAA </td>
<td class="odd">WAPCAA </td>
<td class="odd">A33020 </td>
<td class="odd">014386963 </td>
<td class="odd" nowrap>ALARM CHE AG AUTO M22 </td>
<td class="odd">A12 </td>
<td class="odd">Y14-M-15375 </td>
<td class="odd" align="center">8 </td>
<td class="odd" align="center">N </td>
<td class="odd" valign="middle">
<select name="select2" id="select2" onChange="displayDODAAC('rep_loc2','2','WAPCAA','A33020','09-03-2008','6665','014386963','ALARM CHE AG AUTO M22','','A12','Y14-M-15375','8','N','9GQ','','17','WAPCAA')">
<option value=""> </option>
<option id="WK9E2N" value="WK9E2N">CP EDERLE (WK9E2N)</option>
<option id="W800TM" value="W800TM">KAISERSLA (W800TM)</option>
<option id="W803CR" value="W803CR">KAISERSLA (W803CR)</option>
<option id="W804T6" value="W804T6">KAISERSLA (W804T6)</option>
<option id="W80N53" value="W80N53">KAISERSLA (W80N53)</option>
<option id="W80N6Y" value="W80N6Y">KAISERSLA (W80N6Y)</option>
<option id="W80Q7B" value="W80Q7B">KAISERSLA (W80Q7B)</option>
<option id="W81G2F" value="W81G2F">KAISERSLA (W81G2F)</option>
<option id="W9032N" value="W9032N">KAISERSLA (W9032N)</option>
<option id="W91LEP" value="W91LEP">KAISERSLA (W91LEP)</option>
<option id="WK4EYJ" value="WK4EYJ">KAISERSLA (WK4EYJ)</option>
<option id="WK4F10" value="WK4F10">KAISERSLA (WK4F10)</option>
<option id="WK4FZN" value="WK4FZN">KAISERSLA (WK4FZN)</option>
<option id="WK4GCW" value="WK4GCW">KAISERSLA (WK4GCW)</option>
<option id="WK4GCX" value="WK4GCX">KAISERSLA (WK4GCX)</option>
<option id="WK4GFB" value="WK4GFB">KAISERSLA (WK4GFB)</option>
<option id="WK4GGD" value="WK4GGD">KAISERSLA (WK4GGD)</option>
<option id="WK4S0Z" value="WK4S0Z">WIESBADEN (WK4S0Z)</option>
<option id="depot" value="">DEPOT</option>
<option id="cont" value="">CONTRACTOR</option>
<option id="unit" value="">UNIT</option>
</select>
</td>
<td class="odd" valign="middle">
<div id="shipToDodaac2"></div>
<input type="Text" name="ship_to_DODAAC_2" size="15" maxlength="6" disabled="disabled">
</td>
<td class="odd" valign="middle">
<div id="provRemarks2"></div>
<input type="Text" id="PROV_REMARKS_2" name="PROV_REMARKS_2" size="50" maxlength="512" disabled="disabled" />
</td>
<td class="odd" nowrap align="center">17 </td>
</tr>
<div id="fieldItems"></div>
|
This is a cut down part of the source code. The rest of the code is a repeat of the option boxes until 100 has been reached. |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Wed Sep 03, 2008 1:07 pm Post subject: |
|
|
Würde es über 'JavaScript Bookmarklets' probieren. Gibts einiges dazu im Forum. Alternativ über COM (oder derRaphaels httpRequest() function ?).
[Das Deutsche Autohotkey Forum]  |
|
| Back to top |
|
 |
Procyan Guest
|
Posted: Wed Sep 03, 2008 9:11 pm Post subject: |
|
|
| BoBo² wrote: | Würde es über 'JavaScript Bookmarklets' probieren. Gibts einiges dazu im Forum. Alternativ über COM (oder derRaphaels httpRequest() function ?).
[Das Deutsche Autohotkey Forum]  |
How did you know I'm in Germany? hehehe
Well I took your advice and have learned alot but, I have a couple questions.
My last little Tabing Macro worked fine on my computer but at my co-workers computer had a hiccup and then the tab sequence was out of order and it started pasting the information in all of the wrong places. So my original idea like I mentioned above was to try to slow it down by adding sleep commands. When that still didn't work I then wanted to try Javascript because I figured if I could focus on each control before I pasted the information there is no way that would mess up. So this is what I have so far.
| Code: | #4::
InputBox, UIC, Lines, How many lines?
InputBox, DODAAC, DODAAC, What is the ship to DODAAC?
InputBox, Dispo, Disposition, What are the Disposition Instructions for this piece of equipment?
send !d javascript:document.fldForm.select%UIC%.focus(){Enter}
Sleep 50
Send U
Sleep 50
send !d javascript:document.fldForm.ship_to_DODAAC_%UIC%.focus(){Enter}
Sleep 50
Send %DODAAC%
send !d javascript:document.fldForm.PROV_REMARKS_%UIC%.focus(){Enter}
Sleep 50
Send %Dispo% |
Question 1
Even though I specify which control I want focus before I paste information could this run fine on my machine and screw up on my co-workers machine? <If it can mess up I wasted a bunch of time and should have researched how to slow down the Tabber>
Question 2
I now have a different problem with this because with the Tabber I could start at line 50 and say do 50 lines and it would do 50 to 100. Will I need some complicated math to make the new code act the same way?
Question 3
At the end of the page there is a save and continue button. Will the new code "with all of the playing around in the address bar" let the web page function as normal when I click save and continue? |
|
| Back to top |
|
 |
Procyan
Joined: 03 Sep 2008 Posts: 4 Location: Germany
|
Posted: Thu Sep 04, 2008 7:45 am Post subject: |
|
|
I guess I'm talking to myself. Well if anyone cares to take a look I will write my findings.
Well what I wrote on my privious post worked fine on my home machine. On my work machine it does not work. For some reason the Macro is skipping steps and I have no idea why.
How do I write code that will execute without skipping steps or going to fast?
The javascript set focus command works, but the next step "Send U" the U all ways appears in the address bar instead of the combo box that the focus was highlighted to.
Somebody has to have an idea, I will keep researching until I find an answer. |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Thu Sep 04, 2008 10:09 am Post subject: |
|
|
| Code: | SetTitleMatchMode, 2 ; kleines Helferlein!
InputBox, UIC, Lines, How many lines?
!y::
CoontrolFocus, Edit1, <Hier noch den Fenstertitel(bestandteil) eintragen>
ControlSend, Edit1, javascript:document.fldForm.select%UIC%.unit.value="";void(0);,<Hier noch den Fenstertitel(bestandteil) eintragen>
Return | Wenns nicht im IE angezeigt wird, wäre noch vorab das Control (hier: Edit1) zu ermitteln!
Mir verschließt sich noch nicht warum eine Eingabe per Inputbox schneller sein sollte als eine Auswahl über DropDownList im Browser (wahrscheinlich nur Testszenario...). Wodurch wird also final gefüttert? Dokument? Mensch?? Goblin??
Why I answered this in German? The topic is quite common ~ "How to trigger a webform". For me, to explain it in German speeds things up. Thx 4 Ur understanding folx. *BoBo, leaving back to the German AHK-Forum* |
|
| Back to top |
|
 |
Procyan
Joined: 03 Sep 2008 Posts: 4 Location: Germany
|
Posted: Fri Sep 05, 2008 6:59 am Post subject: |
|
|
Thanks everyone for steering me in the right direction. The macro works pretty good though it is not as fast as the Tabbing macro but, if this macro makes a mistake that mistake doesn't cascade throught the entire document which is a plus. The code is probably pretty noob looking with a lack of organization/structure but, it seems to work well enough. This silly little program that this community helped me create is saving me alot time from doing some tedious work. Thanks!
| Code: | SetTitleMatchMode, 2
#NoEnv
#4::
Gui, Add, Text,, Please enter the line you want to start at:
Gui, Add, Text,, Please enter the line you want to end at:
Gui, Add, Text,, What is the ship to DODAAC?
Gui, Add, Text,, What are the disposition instructions?
Gui, Add, Edit, w50 vstart ym
Gui, Add, Edit, w50 vend
Gui, Add, Edit, w50 vdodaac
Gui, Add, Edit, w200 vdispo r5
Gui, Add, Button, default ym, OK
Gui, Show,, Automatic Disposition Provider
return
GuiClose:
ButtonOK:
Gui, Submit
end++
Loop
{
SendInput !d javascript:document.fldForm.select%start%.focus(){Enter}
Sleep 110
Send U
Sleep 50
SendInput !d javascript:document.fldForm.ship_to_DODAAC_%start%.focus(){Enter}
Sleep 120
Send %dodaac%
Sleep 50
SendInput !d javascript:document.fldForm.PROV_REMARKS_%start%.focus(){Enter}
Sleep 120
Send %dispo%
start++
If start = %end%
Goto Done
}
Done:
Reload
Exit |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|