Jump to content

madrocks87

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by madrocks87

  1. It's not actually Excel, its a proprietary application that I can't really get too much into the details of. This particular task is pretty much just copy and pasting, and using AutoIT to automate all the clicks will take a ~1.5 hour task down to about ~10 minutes. I actually have the script mostly written and working, I just really want to trim some lines of code out of the script before I present it to anyone. So the format you're saying would be the following? while $i = 4 - excel() WEnd
  2. while $i = 4 call("excel") WEnd EndFunc Line 35 of the second box above, during the while loop I try to call the function "Excel" that I created in the first box. Perhaps I am not using the right word, I am just trying to nest several commands into a single line so that I don't have to type all of the duplicate code. Thanks, Madrocks
  3. I added the code quotes and separated them a little bit better above. I see what you are saying with the counting row numbers. Let me see if I can iterate it a little bit better below. I essentially am trying to go row by row to perform this task, but there are certain blocks where it is the same steps, something like this: 1 2 3 A B C D E F 4 5 6 A B C D E F 7 8 9 etc What I am trying to do is essentially create a function for A-F, then write it as 1 2 3 Call function 4 5 6 Call function etc in order to save time writing out all of that duplicate code. Please let me know if that helps. Thanks, Madrocks
  4. Hey guys, total newbie here, hoping you guys could lend me a hand. I've done some Googling, but I think I am having trouble phrasing what I am trying to do. Basically, I have a task that involves copying data from a spreadsheet and copying it into another sheet on a daily basis. The two sheets are structured exactly the same every day, so I figured it would be a good candidate for an AutoIT script. Essentially, I am trying to create a loop that will go through each column and copy out the data that I need. While creating the loop, I found that there were several sections where 4-10 of the steps were exactly the same, before going to a new line and having to select different cells/areas. What I would like to do is create functions for these repetitive steps, call them, then continue on with the loop. Example pasted below: Function: Func Excel() $i=0 while $i = 0 Send("^c") $i=$i+1 sleep(300) WEnd while $i = 1 MouseClick("left", 450, 1060, 1) $i=$i+1 sleep(300) WEnd while $i = 2 Send("^v") $i=$i+1 sleep(300) WEnd while $i = 3 Send("{RIGHT}") $i=$i+1 sleep(300) WEnd while $i = 4 MouseClick("left", 450, 1060, 1) $i=$i+1 sleep(300) WEnd EndFunc Then, after writing the function, I am trying to call it in a loop as seen below: while $i = 1 MouseClick("left", 450, 1060, 1) $i=$i+1 sleep(300) WEnd while $i = 2 Send("^v") $i=$i+1 sleep(300) WEnd while $i = 3 Send("{RIGHT}") $i=$i+1 sleep(300) WEnd while $i = 4 call("excel") WEnd EndFunc while $i = 5 MouseClick("left", 450, 1060, 1) $i=$i+1 sleep(300) WEnd ETC... Essentially, the issue I am having, is that the function is successfully called and executes properly, but the loop stops at the function and will not continue on to the next step ($i = 5 in this case). That is the gist of it, hopefully I explained it adequately. I am just starting out on this, so I'm sure the code could be tightened up, and I appreciate any time and responses I receive. Thanks, Madrocks
×
×
  • Create New...