pervezshaikh Posted March 22, 2015 Posted March 22, 2015 Yesterday I asked for help, but surprisingly it is not available now. It seems my question is lost in cyberspace. I have run into AutoIT couple of days ago. It is interesting to me as I keep on working to a MS Word file where I am to perform a number of repetitive actions of mouse clicks and keystrokes. I opened the file through following code $MSWordPath= "D:Program FilesMicrosoft OfficeOffice12WINWORD.EXE" $parameter = ' "E:Backup-requiredBackupKnowledgeManagementEbooksMainDoc.docx"' Run($MSWordPath & $parameter) Afterwards, I need to send few keystrokes as ALT+w. I used Send("!w") Here comes my problem. As MainDoc.docx requires certain time to get open the keystrokes were lost. There can be a possible solution. A dialogue box may be inserted with an OK button to get manual pause. When OK button is clicked, the dialogue box may disappear and focus should shift to Word file. Will someone help me how to code it?
MikahS Posted March 22, 2015 Posted March 22, 2015 (edited) Have a look at RunWait() Edited March 22, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
pervezshaikh Posted March 22, 2015 Author Posted March 22, 2015 Hi Breathe! RunWait()=Runs an external program and pauses script execution until the program finishes. No doubt the script stops, but it stops till I exit MainDoc.docx file. This tip is not helpful.
orbs Posted March 22, 2015 Posted March 22, 2015 pervezshaikh, welcome to AutoIt and to the forum! AutoIt is shipped with a UDF (a library of functions) to manipulate Word by COM - that's an API (advanced programming interface), with which you can automate pretty much everything in Word, without relying on mouse click and key press. look in the help file: Contents > User Defined Functions > Word Management Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
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