mr-es335 Posted March 7 Posted March 7 (edited) Good day, Firstly...here is the script: Spoiler expandcollapse popup; ----------------------------------------------- #include <Array.au3> #include "ExtMsgBox.au3" ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $iExtTimeOut = 2000 Global $iEMBWidth = 850 Global $iMsgDelay = 4 ; --------------------- Global $sAIDataPath = "D:\App_Install\Digital_Audio\" ; ----------------------------------------------- GetVar() ; ----------------------------------------------- Func GetVar() Local $sVar[] = [ _ "1_RMLLabs", _ "2_GR5", _ "3_Valhalla", _ "4_Sessions"] ; ----------------------------------------------- For $i = 0 To UBound($sVar) - 1 DoesAIDataExist($sVar[$i]) Next EndFunc ;==>GetVar ; ----------------------------------------------- Func DoesAIDataExist($sVar) Local $sResult = AI_DA_Data($sVar) ; ----------------------------------------------- _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth) _ExtMsgBox(64, " ", " Does AI_DA [" & $sVar & "] data exist?", $sResult, $iMsgDelay) EndFunc ;==>DoesAIDataExist ; ----------------------------------------------- Func AI_DA_Data($sVar) Local $aDstData[] = [ _ $sAIDataPath & $sVar & "\Assets\On_SignIn.au3", _ $sAIDataPath & $sVar & "\Assets\On_SignInTest.au3", _ $sAIDataPath & $sVar & "\Deployment\Procedure#Insert.au3", _ $sAIDataPath & $sVar & "\Deployment\Deployment.txt", _ $sAIDataPath & $sVar & "\Development\LaunchExitBoth.au3", _ $sAIDataPath & $sVar & "\Development\EndNotice.au3", _ $sAIDataPath & $sVar & "\Development\Procedure#.au3", _ $sAIDataPath & $sVar & "\Development\CreateSignInLinkB.au3", _ $sAIDataPath & $sVar & "\Development\SignMeOut.au3", _ $sAIDataPath & $sVar & "\Development\Development.txt", _ $sAIDataPath & $sVar & "\Functions\CreateSignInTestLinkB.au3", _ $sAIDataPath & $sVar & "\Functions\DeleteStatupLinks.au3", _ $sAIDataPath & $sVar & "\Functions\LaunchExitBoth.au3", _ $sAIDataPath & $sVar & "\Functions\SelectMeBackup.au3", _ $sAIDataPath & $sVar & "\Functions\SelectMeRestore.au3", _ $sAIDataPath & $sVar & "\Functions\Functions.txt", _ $sAIDataPath & $sVar & "\Support\CheckPaths.au3", _ $sAIDataPath & $sVar & "\Support\1_SignOut.au3", _ $sAIDataPath & $sVar & "\Support\2_DeleteAllData.au3", _ $sAIDataPath & $sVar & "\Support\3_DoesDataExist.au3", _ $sAIDataPath & $sVar & "\Support\Procedure_Headings.lnk"] ; ----------------------------------------------- _ArrayColInsert($aDstData, 1) ; ----------------------------------------------- For $i = 0 To UBound($aDstData) - 1 $aDstData[$i][1] = FileExists($aDstData[$i][0]) ? "...Yes " : "...No " Next ; ----------------------------------------------- Return _ArrayToString($aDstData, "") EndFunc ;==>AI_DA_Data ; ----------------------------------------------- As can be observed, the are 4 variables, with FileExist checking the existence of 21 data files in each instance! Ok! So far-so good! However, when checking 1_RMLLabs, the results display 23 files - when there should only be 21?!? If I remove the "1_" from 1_RMLabs...then ALL is fine! What is going on here?!?! I would REALLY appreciate assistance here UPDATE #1! This is WEIRD!! If I rename "1_RMLLabs" to 1_RML"...ALL IS FINE!! UPDATE #2~ This is possible even WEIRD-ER!! I am having the SAME issues with "4_Sessions"! If I rename "4_Sessions" to "4_Session"...ALL IS FINE!! Edited March 7 by mr-es335 mr-es335 Sentinel Music Studios
Solution ioa747 Posted March 7 Solution Posted March 7 (edited) Make it simpler expandcollapse popup; ----------------------------------------------- Func DoesAIDataExist($sVar) Local $sResult = AI_DA_Data($sVar) ConsoleWrite($sVar & " <--" & @CRLF & $sResult & @CRLF) _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth) _ExtMsgBox(64, " ", " Does AI_DA [" & $sVar & "] data exist?", $sResult, $iMsgDelay) EndFunc ;==>DoesAIDataExist ; ----------------------------------------------- Func AI_DA_Data($sVar) Local $aDstData[] = [ _ "\Assets\On_SignIn.au3", _ "\Assets\On_SignInTest.au3", _ "\Deployment\Procedure#Insert.au3", _ "\Deployment\Deployment.txt", _ "\Development\LaunchExitBoth.au3", _ "\Development\EndNotice.au3", _ "\Development\Procedure#.au3", _ "\Development\CreateSignInLinkB.au3", _ "\Development\SignMeOut.au3", _ "\Development\Development.txt", _ "\Functions\CreateSignInTestLinkB.au3", _ "\Functions\DeleteStatupLinks.au3", _ "\Functions\LaunchExitBoth.au3", _ "\Functions\SelectMeBackup.au3", _ "\Functions\SelectMeRestore.au3", _ "\Functions\Functions.txt", _ "\Support\CheckPaths.au3", _ "\Support\1_SignOut.au3", _ "\Support\2_DeleteAllData.au3", _ "\Support\3_DoesDataExist.au3", _ "\Support\Procedure_Headings.lnk"] Local $sFile, $sResult = "" For $i = 0 To UBound($aDstData) - 1 $sFile = $sAIDataPath & $sVar & $aDstData[$i] $sResult &= $i + 1 & ") .." & $aDstData[$i] & (FileExists($sFile) ? "...Yes" : "...No") & @CRLF Next Return $sResult EndFunc ;==>AI_DA_Data ; ----------------------------------------------- Edited March 7 by ioa747 mr-es335 1 I know that I know nothing
mr-es335 Posted March 7 Author Posted March 7 (edited) ioa747, Firstly, "Thanks!" [As always!!!] Secondly, How in the world do you folks DO the things that you DO? • What I mean by this is, "How do you come to think in this manner?" • Here I thought that I was "improving" - modifying your earlier offering...only to discover that I am not really improving at all! Thirdly, how did YOUR suggestion resolve the issue with "1_RMLLabs" and "4_Sessions"? Edited March 7 by mr-es335 ioa747 1 mr-es335 Sentinel Music Studios
ioa747 Posted March 7 Posted March 7 the problem must have been here Return _ArrayToString($aDstData, "") However, since you wanted text at the end and not an array, I didn't go into the logic to look for it. I made it text directly I know that I know nothing
mr-es335 Posted March 7 Author Posted March 7 (edited) Hello, How is this?: expandcollapse popup; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- GetPaths() ; ----------------------------------------------- Func GetPaths() ; [Src path] Local $sSrcScriptPath = "D:\System_Data\Scripts\Consolidated\" Local $sSrcData = "1_SignOut.au3" Local $sCombSrcVar = $sSrcScriptPath & $sSrcData ; --------------------- ; [Dst path] Local $sAIDstPath = "D:\App_Install\Digital_Audio\" Local $sAIDstProcFolder = "1_RMLLabs" Local $sAIDstFolder = "\Assets\" Local $sCombDstVar = $sAIDstPath & $sAIDstProcFolder & $sAIDstFolder ; ----------------------------------------------- ConsoleWrite("[Src path]" & @CRLF) ConsoleWrite("Actual source path: D:\System_Data\Scripts\Consolidated\1_SignOut.au3" & @CRLF) ConsoleWrite("Variables required: $sSrcScriptPath.....................$sSrcData" & @CRLF) ConsoleWrite("Combined variables: " & $sSrcScriptPath & $sSrcData & @CRLF) ConsoleWrite("$sCombSrcVar: " & $sCombSrcVar & @CRLF) ; --------------------- ConsoleWrite("; -----------------------------------------------" & @CRLF) ConsoleWrite("[Dst path]" & @CRLF) ConsoleWrite("Actual dst path 1: D:\App_Install\Digital_Audio\1_RMLLabs\Assets\" & @CRLF) ConsoleWrite("Actual dst path 2: D:\App_Install\Digital_Audio\1_RMLLabs\ Assets\" & @CRLF) ConsoleWrite("Variables required: $sAIDstPath..................$sAIDstProcFolder......$sAIDstFolder" & @CRLF) ConsoleWrite("Combined variables: " & $sAIDstPath & $sAIDstProcFolder & $sAIDstFolder & @CRLF) ConsoleWrite("$sCombDstVar: " & $sCombDstVar & @CRLF) ; --------------------- ConsoleWrite("; -----------------------------------------------" & @CRLF) ConsoleWrite("[Copy routine]" & @CRLF) ConsoleWrite("FileCopy(" & $sCombSrcVar & ", " & $sCombDstVar & ")" & @CRLF) ConsoleWrite("; -----------------------------------------------" & @CRLF) ConsoleWrite("" & @CRLF & @CRLF) EndFunc ;==>GetPaths ; ----------------------------------------------- Edited March 7 by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted March 8 Posted March 8 I would say it's overengineered ... but if it helps you memorize the routes, it's okay I know that I know nothing
mr-es335 Posted March 8 Author Posted March 8 Yep! This was done solely for "learning purposes"! ioa747 1 mr-es335 Sentinel Music Studios
mr-es335 Posted March 8 Author Posted March 8 Hello, In the following: expandcollapse popup; ----------------------------------------------- #include "ExtMsgBox.au3" ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $iEMBWidth = 850 Global $iMsgDelay = 2 ; --------------------- Global $sAIDataPath = "D:\App_Install\Digital_Audio\" ; ----------------------------------------------- GetVar() ; ----------------------------------------------- Func GetVar() Local $sProcFolder[] = [ _ "1_RMLLabs"] ; ----------------------------------------------- For $i = 0 To UBound($sProcFolder) - 1 DoesAIDataExist($sProcFolder[$i]) Next EndFunc ;==>GetVar ; ----------------------------------------------- Func DoesAIDataExist($sProcFolder) Local $sResult = AI_DA_Data($sProcFolder) ; ----------------------------------------------- _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth) _ExtMsgBox(64, " ", " Deleting all AI_DA [" & $sProcFolder & "] data...", $sResult, $iMsgDelay) EndFunc ;==>DoesAIDataExist ; ----------------------------------------------- Func AI_DA_Data($sProcFolder) Local $aDstData[] = [ _ "\Assets\On_SignIn.au3"] ; ----------------------------------------------- Local $sFile, $sResult = "" ; ----------------------------------------------- For $i = 0 To UBound($aDstData) - 1 $sFile = $sAIDataPath & $sProcFolder & $aDstData[$i] $sResult &= $i + 1 & "] ..." & $aDstData[$i] & (FileDelete($sFile)) & @CRLF ConsoleWrite("$sResult=" & $sResult & @CRLF) Next ; ----------------------------------------------- Return $sResult EndFunc ;==>AI_DA_Data ; ----------------------------------------------- ConsoleWrite is producing the following output: $sResult=1] ...\Assets\On_SignIn.au31 May I ask how to remove the numeral "1". I have tried StringTrimRight - top no avail. • I would assume that the numeral "1" - or "0", is the return code for the statement. mr-es335 Sentinel Music Studios
mr-es335 Posted March 8 Author Posted March 8 Hello, I do believe that I have "fixed it"?!? For $i = 0 To UBound($aDstData) - 1 $sFile = $sAIDataPath & $sProcFolder & $aDstData[$i] FileDelete($sFile) ;~ $sResult &= $i + 1 & "] ..." & $aDstData[$i] & (FileDelete($sFile)) & @CRLF $sResult &= $i + 1 & "] ..." & $aDstData[$i] & @CRLF Next mr-es335 Sentinel Music Studios
mr-es335 Posted March 11 Author Posted March 11 Good day, One "final" update...I require the last item in the "$aSrcData[]" folder to be a "shortcut" in the "$aDstData[]" folder. After much head-scratching and "ConsoleWriting", I do believe that I have come up with a "workable" solution!?! Spoiler expandcollapse popup; ----------------------------------------------- ; Example: WorkingD ; 3/11/2026 2:42:42 PM ; ----------------------------------------------- #include "ExtMsgBox.au3" #include <FileConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $iEMBWidth = 850 Global $iMsgDelay = 2 ; --------------------- Global $sSrcScriptPath = "D:\System_Data\Scripts\Consolidated\" Global $sAIDataPath = "D:\App_Install\Digital_Audio\" ; ----------------------------------------------- GetAIVar() ; ----------------------------------------------- Func GetAIVar() Local $sProcFolder[] = [ _ "1_RMLLabs", _ "2_GR5", _ "3_Valhalla", _ "4_Sessions"] ; ----------------------------------------------- For $i = 0 To UBound($sProcFolder) - 1 DoesAIDataExist($sProcFolder[$i]) Next EndFunc ;==>GetAIVar ; ----------------------------------------------- Func DoesAIDataExist($sProcFolder) Local $sResult = AI_DA_Data($sProcFolder) ; ----------------------------------------------- _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth) _ExtMsgBox(64, " ", " Copying all AI_DA [" & $sProcFolder & "] data...", $sResult, $iMsgDelay) EndFunc ;==>DoesAIDataExist ; ----------------------------------------------- Func AI_DA_Data($sProcFolder) Local $aSrcData[] = [ _ "On_SignIn.au3", _ "On_SignInTest.au3", _ "Procedure#Insert.au3", _ "Deployment.txt", _ "LaunchExitBoth.au3", _ "EndNotice.au3", _ "Procedure#.au3", _ "CreateSignInLinkB.au3", _ "SignMeOut.au3", _ "Development.txt", _ "CreateSignInTestLinkB.au3", _ "DeleteStatupLinks.au3", _ "LaunchExitBoth.au3", _ "SelectMeBackup.au3", _ "SelectMeRestore.au3", _ "Functions.txt", _ "CheckPaths.au3", _ "1_SignOut.au3", _ "2_DeleteAllData.au3", _ "3_DoesDataExist.au3", _ "Procedure_Headings.txt"] ; ----------------------------------------------- Local $aDstData[] = [ _ "\Assets\", _ "\Assets\", _ "\Deployment\", _ "\Deployment\", _ "\Development\", _ "\Development\", _ "\Development\", _ "\Development\", _ "\Development\", _ "\Development\", _ "\Functions\", _ "\Functions\", _ "\Functions\", _ "\Functions\", _ "\Functions\", _ "\Functions\", _ "\Support\", _ "\Support\", _ "\Support\", _ "\Support\", _ "\Support\Procedure_Headings.lnk"] ; ----------------------------------------------- Local $sSrcDataPath, $sDstDataPath, $sSrcLinkPath, $sDstLinkPath, $aInc = 20, $sResult = "" ; ----------------------------------------------- For $i = 0 To UBound($aSrcData) - 1 $sSrcDataPath = $sSrcScriptPath & $aSrcData[$i] $sDstDataPath = $sAIDataPath & $sProcFolder & $aDstData[$i] $sSrcLinkPath = $sSrcScriptPath & $aSrcData[$aInc] $sDstLinkPath = $sAIDataPath & $sProcFolder & $aDstData[$aInc] ; --------------------- FileCopy($sSrcDataPath, $sDstDataPath, $FC_OVERWRITE + $FC_CREATEPATH) ; --------------------- FileCreateShortcut($sSrcScriptPath & $aSrcData[$aInc], $sAIDataPath & $sProcFolder & $aDstData[$aInc]) ;~ ConsoleWrite($sSrcLinkPath & ", " & $sDstLinkPath & @CRLF) ;~ ConsoleWrite($sAIDataPath & $sProcFolder & $aDstData[$aInc] & @CRLF) ; --------------------- $sResult &= $i + 1 & "] ..." & $aSrcData[$i] & " " & @CRLF Next ; ----------------------------------------------- Return $sResult EndFunc ;==>AI_DA_Data ; ----------------------------------------------- Any comments|suggestions would be appreciated! mr-es335 Sentinel Music Studios
ioa747 Posted March 11 Posted March 11 2 hours ago, mr-es335 said: After much head-scratching and "ConsoleWriting" This is the right way I know that I know nothing
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