Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

One giant Send() call vs. many smaller Send() calls

$
0
0

Hello,

 

I am new to AutoIt, and this is my first post on these forums. I just have a brief question regarding the Send() function, and how I use it in my code.

The task that I am trying to automate requires a long sequence of keystrokes, one right after the other.  I could just put all of the keystrokes  into one string, and pass that to the Send() function. However, I've decided to break my one Send() call up into many smaller Send() calls instead, one right after the other. 

 

Why do I do this? For readability and understanding.  Otherwise, I just have one giant line with a Send() call that is very hard to dissect/understand, even with comments.  My question, however, is the following: would this make my program noticeably less efficient? I don't know how much overhead is involved in calling Send(), much less any function in AutoIt, but is it enough to make a difference after a myriad of Send() calls?  An excerpt from my program is below (this part is in a loop actually):

  1.     Send("{ALT}m") ; Access Music Tools -> Options menu
  2.     Send("e") ; Select end point of video
  3.     Send("^c") ; Copy time
  4.     Send("{ESC}") ; Exit text box
  5.     Send("{ALT}v") ; Select Video Tools -> Edit
  6.     Send("d") ; Select duration of video
  7.     Send("^v") ; Paste time
  8.     Send("{BS}{ENTER}") ; remove "s" so time is purely numerical

Also, a bit unrelated to the topic at hand, but is there much of a difference between using, say, ^ vs. {CTRL} for the CTRL key? I know that, for example, this allows for easier repition, e.g. {CTRL 4}, but is there any difference in delay per keystroke between Send("{CTRL}c") and Send("^c")?

 

Thanks,

Kyle


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>