mr-es335 Posted November 24 Author Posted November 24 (edited) ioa747, ; ----------------------------------------------- ;Path Status Error ;F:\Audio\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_1\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_1\Test Not Passed See Image_1 ;F:\Audio\Type_1\Test\wav Passed "You must to select a valid Type_#\Set_Name folder..." ; ----------------------------------------------- All is "working" as it now should, with the exception of the text file and the wave data should both be placed in the \wav folder. Edited November 24 by mr-es335 Updated image mr-es335 Sentinel Music Studios
ioa747 Posted November 24 Posted November 24 (edited) I updated it above. Edited November 24 by ioa747 I know that I know nothing
mr-es335 Posted November 24 Author Posted November 24 ioa747, ; ----------------------------------------------- ; For Type_1 ;Path Status Error ;F:\Audio\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_1\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_1\Test Passed None! ;F:\Audio\Type_1\Test\wav Passed "You must to select a valid Type_#\Set_Name folder..." ; ----------------------------------------------- ; For Type_2 ;Path Status Error ;F:\Audio\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_2\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_2\Test Passed None! ;F:\Audio\Type_2\Test\wav Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_2\A\Test\wav Not Passed "You must to select a valid Type_#\Set_Name folder..."[1] ; ----------------------------------------------- [1] As noted here... b) F:\Audio\Type_2\E\ [The "Key" of the song] • The Sub folder ["Key'] is fixed... Interestingly,. the previous script that I provided, DOES WORK! • That script is provided below... _Working2.au3 mr-es335 Sentinel Music Studios
ioa747 Posted November 24 Posted November 24 (edited) This a) F:\Audio\Type_2\E [The "Key" of the song] with this b) F:\Audio\Type_2\E\ [The "Key" of the song] is not the same, in b is one level deeper Do you want it to 'grab' even deeper? Edited November 24 by ioa747 I know that I know nothing
mr-es335 Posted November 24 Author Posted November 24 (edited) ioa747, The following function does this at present: ; ----------------------------------------------- ; GLOBAL FUNCTIONS Func _MoveSourceAudioData($g_SetName) While 1 Select Case StringMid($g_SetName, 10, 6) = "Type_1" FileMove($g_sSourceAudioPath & "\*.*", $g_SetName & "\wav", $FC_OVERWRITE) $g_SetNameWave = $g_SetName & "\wav" ExitLoop Case StringMid($g_SetName, 10, 6) = "Type_2" FileMove($g_sSourceAudioPath & "\*.*", $g_SetName & "\wav", $FC_OVERWRITE) $g_SetNameWave = $g_SetName & "\wav" ExitLoop Case StringMid($g_SetName, 10, 6) = "Type_3" FileMove($g_sSourceAudioPath & "\*.*", $g_SetName & "\wav", $FC_OVERWRITE) $g_SetNameWave = $g_SetName & "\wav" ExitLoop Case StringMid($g_SetName, 10, 6) = "Type_4" FileMove($g_sSourceAudioPath & "\*.*", $g_SetName & "\wav", $FC_OVERWRITE) $g_SetNameWave = $g_SetName & "\wav" ExitLoop EndSelect WEnd EndFunc ;==>_MoveSourceAudioData ; ----------------------------------------------- Edited November 24 by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted November 24 Posted November 24 (edited) with which _BrowseForFolder() made a script run by itself as I did above so I can test it Edit: As I mentioned above, this can be replaced with ; ----------------------------------------------- ; GLOBAL FUNCTIONS Func _MoveSourceAudioData($g_SetName) FileMove($g_sSourceAudioPath & "\*.*", $g_SetName, $FC_OVERWRITE) $g_SetNameWave = $g_SetName EndFunc ;==>_MoveSourceAudioData ; ----------------------------------------------- Edited November 24 by ioa747 mr-es335 1 I know that I know nothing
mr-es335 Posted November 25 Author Posted November 25 (edited) ioa747, ; ----------------------------------------------- ; For Type_2, 3rd Test ;Path Status Error ;F:\Audio\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_2\ Passed "You must to select a valid Type_#\Set_Name folder..." ;F:\Audio\Type_2\A Passed None! ; ----------------------------------------------- Got it! Now, if I am able to understand what was required to "fix" the various anomalies!?! I will follow-up tomorrow...you must be exhausted!!! I know that I am!!! Edited November 25 by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted November 25 Posted November 25 (edited) I was left with the question, how deep does it go into folders, even if they are like this? F:\Audio\Type_2\New folder\Elvis\song1 can $g_SetName be the song1 ? or The root folder is always: F:\Audio\ The first sub-folder must be a: $_sTypeFolder variable For Type_1, Type_2 The second sub-folder must be the $g_SetName Edited November 25 by ioa747 I know that I know nothing
mr-es335 Posted November 25 Author Posted November 25 ioa747, You stated, "The root folder is always: F:\Audio\...The first sub-folder must be a: $_sTypeFolder variable For Type_1, Type_2...The second sub-folder must be the $g_SetName" Yes! That is correct1 [Click_Me] The above states: |-----Begin The root folder is always: F:\Audio\ The first sub-folder must be a: $_sTypeFolder variable • For Type_1, Type_2 The second sub-folder must be a: $g_SetName variable • This name could be anything that defines the name of the set, for example: a) F:\Audio\Type_1\TheRighteousBrothers [The name of the group or artist] b) F:\Audio\Type_2\E [The "Key" of the song] As noted, within the above F:\Audio\$_sTypeFolder\$g_SetName paths are two folders entitled: "\edl" and "\wav". ....End| In this regard, the " F:\Audio\Type_2\E" path, ...or, [The "Key" of the song], would be akin to "F:\Audio\Type_1\TheRighteousBrothers". Hope this helps? mr-es335 Sentinel Music Studios
Dan_555 Posted November 25 Posted November 25 (edited) Quote The root folder is always: F:\Audio\ The first sub-folder must be a: $_sTypeFolder variable • For Type_1, Type_2 The second sub-folder must be a: $g_SetName variable • This name could be anything that defines the name of the set, for example: a) F:\Audio\Type_1\TheRighteousBrothers [The name of the group or artist] b) F:\Audio\Type_2\E [The "Key" of the song] As noted, within the above F:\Audio\$_sTypeFolder\$g_SetName paths are two folders entitled: "\edl" and "\wav". This is how i would solve that particular problem: expandcollapse popupGlobal $root = "r:\audio\" Global $sTypeFolder = "Type_1" ;or "Type_2" Global $g_SetName = "TheRighteousBrothers" $test = _CheckPath() ConsoleWrite("error message was =" & $test & @CRLF) Func _CheckPath() ;Error messages 0 = all ok, 1= Root folder does not exists ;2 = $sTypeFolder does not exists, 3= $g_SetName does not exists ;4 = "Edl folder is missing" , 5 = "wav folder is missing" ;6 = "edl and wav folders are missing", 7 = "$sTypeFolder incorrect name (not Type_1 or Type_2) Local $createpath = "", $err = 0 If FileExists($root) Then ConsoleWrite($root & " exists " & @CRLF) If $sTypeFolder = "Type_1" Or $sTypeFolder = "Type_2" Then If FileExists($root & $sTypeFolder) Then $createpath = $root & $sTypeFolder & "\" ConsoleWrite($createpath & " exist " & @CRLF) Else ConsoleWrite($root & $sTypeFolder & " does not exists " & @CRLF) $err = 2 EndIf If $err = 0 Then If FileExists($createpath & $g_SetName) Then $createpath = $createpath & $g_SetName & "\" ConsoleWrite($createpath & " exists " & @CRLF) Else ConsoleWrite($createpath & $g_SetName & " does not exists " & @CRLF) $err = 3 EndIf EndIf If $err = 0 Then If FileExists($createpath & "edl\") Then ConsoleWrite($createpath & "edl exists" & @CRLF) Else ConsoleWrite($createpath & "edl does not exists" & @CRLF) $err = 4 EndIf If FileExists($createpath & "wav\") Then ConsoleWrite($createpath & "wav exists" & @CRLF) Else ConsoleWrite($createpath & "wav does not exists" & @CRLF) If $err = 4 Then $err = 6 Else $err = 5 EndIf EndIf EndIf Else ConsoleWrite($sTypeFolder & " has not a correct name" & @CRLF) $err=7 EndIf Else $err = 1 EndIf Return $err EndFunc ;==>_CheckPath Edited November 25 by Dan_555 Corrected wrongly placed if statement mr-es335 1 Some of my script sourcecode
mr-es335 Posted November 25 Author Posted November 25 Dan_555, Very thorough and in-depth error checking going on here! Thanks for the suggestions...appreciated! mr-es335 Sentinel Music Studios
mr-es335 Posted November 25 Author Posted November 25 ioa747, After an evening rest, I tested out the provided script again. All work as it should, with the exceptions of Type_ and Type_4. Neither of these Types, did require a $g_SetName variable. However, to keep "things" consistent with Type_1 and Type_2, I simply decided to create SetName folder for each of these types. Thus: For Type_3, there are three SetName folders: • F:\Audio\Type_3\Emcee • F:\Audio\Type_3\NStrungGuitar • G:\Audio\Type_3\SStrungGuitar For Type_4, there is only a single SetName folder: • F:\Audio\Type_4\EndOfShow With the above now implemented, all is working as it should!! So, ioa747, you did it again! Many, many thanks for your efforts! PS: A "Thank You" to the rest who provided assistance as well! All are appreciated! ioa747 1 mr-es335 Sentinel Music Studios
mr-es335 Posted November 25 Author Posted November 25 ioa747, May I ask what is the purpose|reason for the comments here...there are two: Local $SetName = FileSelectFolder("Please select a valid Type_#\Set_Name folder...", "F:\Audio\") ; "F:\Audio\" $g_TypeFolder = $_aType[1] & "\" & $_aType[2] & "\" & $_aType[3] ; F:\Audio\$_aType[3]\$_aType[4] So... 1) ; "F:\Audio\" 2) ; F:\Audio\$_aType[3]\$_aType[4] Thanks! mr-es335 Sentinel Music Studios
ioa747 Posted November 25 Posted November 25 it's because I'm changing the path for me and these are the notes to remember where the original is you didn't need them I know that I know nothing
mr-es335 Posted November 25 Author Posted November 25 (edited) ioa747, You had noted, Func _CreateTextListing($SetNameWave) Local $MyT1List = '' ; Assign $MyPath to $MyT1List and create the array $MyT1List = _FileListToArray($SetNameWave) ; ⚠ there is no file mask , cach all file ?? If Not @error Then ; Create the data file _FileCreate($SetNameWave & "\FileListing.txt") ; Write the array to the data file _FileWriteFromArray($SetNameWave & "\FileListing.txt", $MyT1List) EndIf EndFunc ;==>_CreateTextListing ; ----------------------------------------------- Would this be an acceptable "fix"? $MyT1List = _FileListToArray($SetNameWave & "*.wav") Edited November 25 by mr-es335 ioa747 1 mr-es335 Sentinel Music Studios
mr-es335 Posted November 25 Author Posted November 25 (edited) Good day, So, I remove the "Solution" status on this posting, due to the fact that, as I was perusing the text, I came across what I refer to "discrepancies" UPDATE!!: After some 6+ hours, I have re-examined ioa747's script and having now understand - at least in principle, some of the various nuances o that offering, I am again ready to acknowledge that this offering is a viable solution! I know not whether such discrepancies are due to a lack of knowledge on my part [most likely], or an error in the script, I simply cannot say. All that I DO know, is that I am more confused now...than I have ever been! Thus, I am presently revisiting the previous suggestions to see if I will be able to ascertain where the errors lie and how I can go about resolving such errors. For those that are at all interested, I will keep you apprised of my progress! Edited November 26 by mr-es335 mr-es335 Sentinel Music Studios
mr-es335 Posted November 26 Author Posted November 26 Good day, The following is incomplete, but for simplicity-sake, I do believe that the following snippet will suffice? Case $_sCol3Row3 _LaunchWavFolder($g_SetNameWave) ; This is a GLOBAL VARIABLE!!! ; ----------------------------------------------- Func _MoveSourceAudioData($g_SetName) $g_SetNameWave = $g_SetName ; The $g_SetNameWave variable is a global one here!! EndFunc ;==>_MoveSourceAudioData ; ----------------------------------------------- Func _LaunchWavFolder($SetNameWave) ; However, this variable s a LOCAL VARIABLE!!! If Not WinExists($SetNameWave) Then ShellExecute($SetNameWave) WinWaitActive($SetNameWave, "", 3) WinMove($SetNameWave, "", 970, 100, 550, 650) EndFunc ;==>_LaunchWavFolder ; ----------------------------------------------- Notes and Questions 1) The function _LaunchWavFolder($g_SetNameWave) is called employing, as noted, a global variable! 2) However, the actual function is employing a local variable!! How is this so? Func _LaunchWavFolder($SetNameWave) ; This is a LOCAL VARIABLE!!! 3) The variable "$SetNameWave" is first deployed in this function!! How is this also so? • This same variable is also deployed in tow other functions!! 4) Where is this "$SetNameWave" variable derived from? Man! This scenario is very, very confusing!! PS: I am really,..really trying to understand what is going on here! Please be patient with me!! mr-es335 Sentinel Music Studios
mr-es335 Posted November 26 Author Posted November 26 Hello, So, I did this, and it worked!!! Func _LaunchWavFolder($WhoCares) If Not WinExists($WhoCares) Then ShellExecute($WhoCares) WinWaitActive($WhoCares, "", 3) WinMove($WhoCares, "", 970, 100, 550, 650) EndFunc ;==>_LaunchWavFolder I guess I really need to understand what "arguments" are!!! I thought that did have some kind of understanding....but apparently NOT!! mr-es335 Sentinel Music Studios
mr-es335 Posted November 26 Author Posted November 26 Hello, Would the following be a correct assertion? Quote Arguments Parameters consist of arguments Arguments are to be passed to the function being invoked If I understand things correctly then, when arguments are passed to the function being invoked, the arguments being sent and the arguments being received are not required to be one-and-the-same! Thus, _Me() Func _Me() Call("_You", "Take me To lunch!") EndFunc ;==>_Me Func _You($Msg) MsgBox(0, "You", $Msg) EndFunc ;==>_You Would this be correct? mr-es335 Sentinel Music Studios
Moderators Melba23 Posted November 26 Moderators Posted November 26 mr-es335, Although the snippet above works, I wonder why you find it necessary to use Call - you can call the function directly as follows: _Me() Func _Me() _You("Take me To lunch!") EndFunc ;==>_Me Func _You($Msg) MsgBox(0, "You", $Msg) EndFunc ;==>_You 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
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