mancydrew Posted April 17 Share Posted April 17 Hello, I'm super new to AutoIT and I'm working on a making a series of commands to clean up one of my large excel files this includes the reuse of the same commands: Send("+{SPACE}") ;select row Sleep(100) Send("{F10}") ;opens hotkey menu Sleep(100) Send("h") ;opens home menu Sleep(100) Send("d") ;opens delete menu Sleep(100) Send("r") ;deletes row and I was wondering if there was a way to define that group of commands (i,e. "DEL COMMAND" = [then type out those commands once]) so instead of copying/pasting the command multiple times I could just type the defining term of DEL COMMAND or whatever defining term. A while/do/for loop won't work because there's inconsistent down/over keys that need to happen between sets of the DEL COMMAND. Link to comment Share on other sites More sharing options...
Solution Nine Posted April 17 Solution Share Posted April 17 (edited) When you post code, use the method shown in the link. Put all statements into a func and link the function with a HotKeySet , something like this : HotKeySet("{F8}", DelCommand) While Sleep(100) WEnd Func DelCommand() Send("+{SPACE}") ;select row Sleep(100) Send("{F10}") ;opens hotkey menu Sleep(100) Send("h") ;opens home menu Sleep(100) Send("d") ;opens delete menu Sleep(100) Send("r") ;deletes row EndFunc ;==>DelCommand ps. you could also use Excel UDF, to perform those tasks instead of sending keys, which would make your script way more reliable. Edited April 17 by Nine mancydrew 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now