mr-es335 Posted January 19 Posted January 19 (edited) Good day, Not too sure how to title this positing... I have the following script, which places the selected folder in one of three locations, Left, center and Right, - which appears to be doing what that script is 'sposed to! However, I now require a means of being able to exit a previous folder that is occupying that same location. Here is the current script: Spoiler expandcollapse popup; ----------------------------------------------- #include <FileConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $sRootFolder = "E:\RML_Labs" ; ----------------------------------------------- ExitFolder() LaunchSelectedFolder() ; ----------------------------------------------- Func LaunchSelectedFolder() Local $sPrompt = "Notice!" Local $sMessage = "First, enter the folder location: [L]eft, [C]entre or [R]ight" Local $sFolderLocation = InputBox($sPrompt, $sMessage, "", " ", 275, 130) ; --------------------- Local $sMessage = "Select a folder..." Local $sFileOpenDialog = FileSelectFolder($sMessage, $sRootFolder, "Selected Folder (*.*)", $FD_FILEMUSTEXIST) ; ----------------------------------------------- If $sFolderLocation = "l" Then $sFolderLocation = 2000 ElseIf $sFolderLocation = "c" Then $sFolderLocation = 2400 ElseIf $sFolderLocation = "r" Then $sFolderLocation = 2800 EndIf ; ----------------------------------------------- If @error Then Exit Else ShellExecute($sFileOpenDialog) EndIf ; ----------------------------------------------- ; Postion folder Sleep(100) WinMove($sFileOpenDialog, "", $sFolderLocation, 200, 400, 700) EndFunc ;==>LaunchSelectedFolder ; ----------------------------------------------- Func ExitFolder() Local $iStart = 7, $iEnd = 6 Local $sSrcPath[$iStart] = [$iEnd] $sSrcPath[1] = "E:\RML_Labs\4_RMLLabs\To_Deploy" $sSrcPath[2] = "E:\RML_Labs\5_Sessions\To_Deploy" $sSrcPath[3] = "E:\RML_Labs\6_Testing\To_Deploy" $sSrcPath[4] = "E:\Backups\Procedures" $sSrcPath[5] = "C:\Program Files\LiveRigDevelopment" $sSrcPath[6] = "D:\System_Data\Scripts\Menu_Applications\Development_Menu\BoilerPlates" ; ----------------------------------------------- For $i = 1 To 6 WinClose($sSrcPath[$i]) Next EndFunc ;==>ExitFolder ; ----------------------------------------------- As can be observed, my current solution has been to list the following that I believe to be accessed...but not for ones that are "random! Any ideas?? Edited January 19 by mr-es335 mr-es335 Sentinel Music Studios
mr-es335 Posted January 19 Author Posted January 19 Hello, How is this? ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ExitAllFolders ; ----------------------------------------------- Func ExitAllFolders() ; Retrieve a list of window handles for all open windows Local $aList = WinList("[CLASS:CabinetWClass]") ; ----------------------------------------------- ; Loop through the array and close each visible folder window For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then WinClose($aList[$i][1]) EndIf Next EndFunc ;==>ExitAllFolders ; ----------------------------------------------- mr-es335 Sentinel Music Studios
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