Flanders42 Posted December 3, 2012 Share Posted December 3, 2012 I have a script that resizes images so that they're usable on an intranet site. Once the image is resized it's copied to a finished directory. I'd like to have the script loop until the initial directory is empty. I've see the DirGetSize be mentioned but I'm not quite sure how to implement it in the use I'm looking for. Here's my code so far: expandcollapse popupOpt('MouseCoordMode',0) Opt("WinTitleMatchMode", 2) #region ---Au3Recorder generated code Start (v3.3.7.0) --- #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc #endregion --- Internal functions Au3Recorder End --- Do Run('C:\WINDOWS\system32\mspaint.exe') _WinWaitActivate("untitled - Paint","") MouseClick("left",12,28,1) MouseClick("left",30,70,1) _WinWaitActivate("Open","") MouseClick("left",59,163,1) MouseClick("left",127,120,1) MouseClick("left",504,364,1) MouseClick("left",456,47,1) MouseClick("left",476,132,1) MouseClick("left",331,69,1) Sleep(500) MouseClick("left",331,69,1) MouseMove(143,85) MouseDown("left") MouseMove(142,85) MouseUp("left") MouseClick("left",514,359,1) _WinWaitActivate("Paint","") MouseClick("left",111,33,1) MouseClick("left",118,68,1) _WinWaitActivate("Stretch and Skew","") Send("??{TAB}??") MouseClick("left",306,42,1) _WinWaitActivate("Paint","") MouseClick("left",15,33,1) MouseClick("left",31,102,1) _WinWaitActivate("Save As","") MouseClick("left",135,70,1) MouseClick("left",507,360,1) MouseClick("left",507,360,1) _WinWaitActivate("Paint","") MouseClick("left",16,32,1) MouseClick("left",55,360,1) #endregion --- Au3Recorder generated code End --- Until( Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 3, 2012 Moderators Share Posted December 3, 2012 ChrisLanders,Welcome to the AutoIt forum. I would use FileListToArray to get an array of all the files in the folder. You can then loop through the list and use ShellExecute to open them into Paint (assuming that is the default app for their file type) - or Run as you already do but using the filename as a parameter. You run the loop for as many times as you have files - and then you should have actioned all the files. I would also look at actioning the various Paint menus and dialogs directly using AutoIt rather than the messy (and very unreliable) MouseClick method you are using at the moment - after all that is what it is designed to do. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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