mr-es335 Posted 2 hours ago Share Posted 2 hours ago (edited) Good day, Firstly, I hope that I have provided an appropriate title for this posting? Secondly, in the following script, in the function entitled, "_LaunchFolder($_sDstPath1b)" , as noted in the comments, "#cs Instead of employing ClipPut($_sSrcPath), I want to pass $_sSrcPath2 to _ObtainAudioDataListing(). This would negate the need for [;Obtain path from user input] and the subsequent [$MyPath = InputBox] statement in that following script. How would this be accomplished? #ce" Β expandcollapse popup; ----------------------------------------------- #include <File.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Local $hGUI = GUICreate("ShowDevMainMenu", 220, 135) GUISetFont(13, 800, 0, "Calibri") ; ----------------------------------------------- ; COLUMN 1 BUTTONS Local $_sSrcPath1a = GUICtrlCreateButton("Launch Audio Folder", 10, 10, 200, 25) Local $_sSrcPath1b = GUICtrlCreateButton("Obtain Set Name", 10, 40, 200, 25) Local $_sSrcPath1c = GUICtrlCreateButton("Obtain Audio Data Listing", 10, 70, 200, 25) Local $_sSrcPath1d = GUICtrlCreateButton("Exit", 10, 100, 200, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $_sSrcPath1a _LaunchAudioFolder() Case $_sSrcPath1b _ObtainSetName() Case $_sSrcPath1c _ObtainAudioDataListing() Case $_sSrcPath1d _ExitMe() EndSwitch WEnd ; ----------------------------------------------- Func _LaunchAudioFolder() ; Source Data Local $_sSrcPath = "F:\Audio" ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 195, 100, 550, 650) EndFunc ;==>_LaunchAudioFolder ; ----------------------------------------------- Func _ObtainSetName() ; Source data Local $_sSrcPath = InputBox("NOTICE!", "Enter Set Name...", "", "", 200, 130) ; ----------------- ; Destination data Local $_sDstPath1b = $_sSrcPath ; ----------------------------------------------- _RenameT1Folder($_sDstPath1b) EndFunc ;==>_ObtainSetName ;----------------------------------------------- Func _RenameT1Folder($_sDstPath1b) ; Source data Local $_sSrcPath = "F:\Audio\Masters\Type_1" ;---------------- ; Destination data Local $_sDstPath1a = "F:\Audio\Type_1" ;----------------------------------------------- DirCopy($_sSrcPath, $_sDstPath1a & "\" & $_sDstPath1b, $FC_OVERWRITE + $FC_CREATEPATH) ;----------------------------------------------- _LaunchFolder($_sDstPath1b) EndFunc ;==>_RenameT1Folder ;----------------------------------------------- Func _LaunchFolder($_sDstPath1b) ; Source Data Local $_sSrcPath = "F:\Audio\Type_1\" & $_sDstPath1b & "\wav" ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 1180, 100, 550, 650) ; ----------------------------------------------- #cs Instead of employing ClipPut($_sSrcPath), I want to pass $_sSrcPath2 to _ObtainAudioDataListing(). This would negate the need for [;Obtain path from user input] and the subsequent [$MyPath = InputBox] statement in that following script. How would this be accomplished? #ce ClipPut($_sSrcPath) ;Local $_sSrcPath2 = $_sSrcPath EndFunc ;==>_LaunchFolder ; ----------------------------------------------- Func _ObtainAudioDataListing() Local $MyPath = "" Local $MyList = "" ;---------------- ; Obtain path from user input $MyPath = InputBox("NOTICE!", "Enter the complete .wav file path...", "", "", 200, 130) ; ----------------------------------------------- ; Assign $MyPath to $MyList and create the array $MyList = _FileListToArray($MyPath) ; Create the data file _FileCreate($MyPath & "\FileListing.txt") ; Write the array to the data file _FileWriteFromArray($MyPath & "\FileListing.txt", $MyList) ; ----------------------------------------------- Local $_sSrcPath = $MyPath & "\FileListing.txt" _LaunchText($_sSrcPath) EndFunc ;==>_ObtainAudioDataListing ; ----------------------------------------------- Func _LaunchText($_sSrcPath) ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 1180, 100, 550, 650) EndFunc ;==>_LaunchText ; ----------------------------------------------- Func _ExitMe() Exit EndFunc ;==>_ExitMe ; ----------------------------------------------- Any assistance in this matter would be greatly appreciated! Note: I can perform this operation WITHOUT the GUI, but have been unsuccessful WITH the GUI! Edited 1 hour ago by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
ioa747 Posted 1 hour ago Share Posted 1 hour ago (edited) you can use a global variable Edited 1 hour ago by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
mr-es335 Posted 1 hour ago Author Share Posted 1 hour ago ioa747, Like this... expandcollapse popup; ----------------------------------------------- #include <File.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Local $hGUI = GUICreate("ShowDevMainMenu", 220, 135) GUISetFont(13, 800, 0, "Calibri") ; ----------------------------------------------- ; COLUMN 1 BUTTONS Local $_sSrcPath1a = GUICtrlCreateButton("Launch Audio Folder", 10, 10, 200, 25) Local $_sSrcPath1b = GUICtrlCreateButton("Obtain Set Name", 10, 40, 200, 25) Local $_sSrcPath1c = GUICtrlCreateButton("Obtain Audio Data Listing", 10, 70, 200, 25) Local $_sSrcPath1d = GUICtrlCreateButton("Exit", 10, 100, 200, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $_sSrcPath1a _LaunchAudioFolder() Case $_sSrcPath1b _ObtainSetName() Case $_sSrcPath1c _ObtainAudioDataListing() Case $_sSrcPath1d _ExitMe() EndSwitch WEnd ; ----------------------------------------------- Func _LaunchAudioFolder() ; Source Data Local $_sSrcPath = "F:\Audio" ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 195, 100, 550, 650) EndFunc ;==>_LaunchAudioFolder ; ----------------------------------------------- Func _ObtainSetName() ; Source data Local $_sSrcPath = InputBox("NOTICE!", "Enter Set Name...", "", "", 200, 130) ; ----------------- ; Destination data Local $_sDstPath1b = $_sSrcPath ; ----------------------------------------------- _RenameT1Folder($_sDstPath1b) EndFunc ;==>_ObtainSetName ;----------------------------------------------- Func _RenameT1Folder($_sDstPath1b) ; Source data Local $_sSrcPath = "F:\Audio\Masters\Type_1" ;---------------- ; Destination data Local $_sDstPath1a = "F:\Audio\Type_1" ;----------------------------------------------- DirCopy($_sSrcPath, $_sDstPath1a & "\" & $_sDstPath1b, $FC_OVERWRITE + $FC_CREATEPATH) ;----------------------------------------------- _LaunchFolder($_sDstPath1b) EndFunc ;==>_RenameT1Folder ;----------------------------------------------- Func _LaunchFolder($_sDstPath1b) ; Source Data Local $_sSrcPath1 = "F:\Audio\Type_1\" & $_sDstPath1b & "\wav" ; ----------------------------------------------- ShellExecute($_sSrcPath1) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath1, "", 1180, 100, 550, 650) ; ----------------------------------------------- ;ClipPut($_sSrcPath) Global $_sSrcPath2 = $_sSrcPath1 EndFunc ;==>_LaunchFolder ; ----------------------------------------------- Func _ObtainAudioDataListing() Local $MyPath = $_sSrcPath2 Local $MyList = "" ; ----------------------------------------------- ; Assign $MyPath to $MyList and create the array $MyList = _FileListToArray($MyPath) ; Create the data file _FileCreate($MyPath & "\FileListing.txt") ; Write the array to the data file _FileWriteFromArray($MyPath & "\FileListing.txt", $MyList) ; ----------------------------------------------- Local $_sSrcPath = $MyPath & "\FileListing.txt" _LaunchText($_sSrcPath) EndFunc ;==>_ObtainAudioDataListing ; ----------------------------------------------- Func _LaunchText($_sSrcPath) ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 1180, 100, 550, 650) EndFunc ;==>_LaunchText ; ----------------------------------------------- Func _ExitMe() Exit EndFunc ;==>_ExitMe ; ----------------------------------------------- Β mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Solution ioa747 Posted 1 hour ago Solution Share Posted 1 hour ago (edited) you can use a global variable somehow like that expandcollapse popup; ----------------------------------------------- #include <File.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Local $hGUI = GUICreate("ShowDevMainMenu", 220, 135) GUISetFont(13, 800, 0, "Calibri") ; ----------------------------------------------- ; COLUMN 1 BUTTONS Local $_sSrcPath1a = GUICtrlCreateButton("Launch Audio Folder", 10, 10, 200, 25) Local $_sSrcPath1b = GUICtrlCreateButton("Obtain Set Name", 10, 40, 200, 25) Local $_sSrcPath1c = GUICtrlCreateButton("Obtain Audio Data Listing", 10, 70, 200, 25) Local $_sSrcPath1d = GUICtrlCreateButton("Exit", 10, 100, 200, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- Global $g_sSrcPath2 ; * <---- you can use a global variable While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $_sSrcPath1a _LaunchAudioFolder() Case $_sSrcPath1b _ObtainSetName() Case $_sSrcPath1c _ObtainAudioDataListing() Case $_sSrcPath1d _ExitMe() EndSwitch WEnd ; ----------------------------------------------- Func _LaunchAudioFolder() ; Source Data Local $_sSrcPath = "F:\Audio" ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 195, 100, 550, 650) EndFunc ;==>_LaunchAudioFolder ; ----------------------------------------------- Func _ObtainSetName() ; Source data Local $_sSrcPath = InputBox("NOTICE!", "Enter Set Name...", "", "", 200, 130) ; ----------------- ; Destination data Local $_sDstPath1b = $_sSrcPath ; ----------------------------------------------- _RenameT1Folder($_sDstPath1b) EndFunc ;==>_ObtainSetName ;----------------------------------------------- Func _RenameT1Folder($_sDstPath1b) ; Source data Local $_sSrcPath = "F:\Audio\Masters\Type_1" ;---------------- ; Destination data Local $_sDstPath1a = "F:\Audio\Type_1" ;----------------------------------------------- DirCopy($_sSrcPath, $_sDstPath1a & "\" & $_sDstPath1b, $FC_OVERWRITE + $FC_CREATEPATH) ;----------------------------------------------- _LaunchFolder($_sDstPath1b) EndFunc ;==>_RenameT1Folder ;----------------------------------------------- Func _LaunchFolder($_sDstPath1b) ; Source Data Local $_sSrcPath = "F:\Audio\Type_1\" & $_sDstPath1b & "\wav" ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 1180, 100, 550, 650) ; ----------------------------------------------- #cs Instead of employing ClipPut($_sSrcPath), I want to pass $_sSrcPath2 to _ObtainAudioDataListing(). This would negate the need for [;Obtain path from user input] and the subsequent [$MyPath = InputBox] statement in that following script. How would this be accomplished? #ce ;~ ClipPut($_sSrcPath) $g_sSrcPath2 = $_sSrcPath EndFunc ;==>_LaunchFolder ; ----------------------------------------------- Func _ObtainAudioDataListing() ;~ Local $MyPath = "" Local $MyList = "" ;---------------- ; Obtain path from user input ;~ $MyPath = InputBox("NOTICE!", "Enter the complete .wav file path...", "", "", 200, 130) ; ----------------------------------------------- ; Assign $MyPath to $MyList and create the array $MyList = _FileListToArray($g_sSrcPath2) ; Create the data file _FileCreate($g_sSrcPath2 & "\FileListing.txt") ; Write the array to the data file _FileWriteFromArray($g_sSrcPath2 & "\FileListing.txt", $MyList) ; ----------------------------------------------- Local $_sSrcPath = $g_sSrcPath2 & "\FileListing.txt" _LaunchText($_sSrcPath) EndFunc ;==>_ObtainAudioDataListing ; ----------------------------------------------- Func _LaunchText($_sSrcPath) ; ----------------------------------------------- ShellExecute($_sSrcPath) ; ----------------------------------------------- Sleep(250) ; ----------------------------------------------- WinMove($_sSrcPath, "", 1180, 100, 550, 650) EndFunc ;==>_LaunchText ; ----------------------------------------------- Func _ExitMe() Exit EndFunc ;==>_ExitMe ; ----------------------------------------------- Β Β Edited 1 hour ago by ioa747 mr-es335 1 I know that I know nothing Link to comment Share on other sites More sharing options...
mr-es335 Posted 1 hour ago Author Share Posted 1 hour ago ioa747, To the rescue again!!! "You ...da' man!!" Thank you so very, very much! mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
ioa747 Posted 59 minutes ago Share Posted 59 minutes ago normally allΒ π these are global, no matter what you call them local any variable is in the main body outside the functions ; ----------------------------------------------- #include <File.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- π Local $hGUI = GUICreate("ShowDevMainMenu", 220, 135) GUISetFont(13, 800, 0, "Calibri") ; ----------------------------------------------- ; COLUMN 1 BUTTONS π Local $_sSrcPath1a = GUICtrlCreateButton("Launch Audio Folder", 10, 10, 200, 25) π Local $_sSrcPath1b = GUICtrlCreateButton("Obtain Set Name", 10, 40, 200, 25) π Local $_sSrcPath1c = GUICtrlCreateButton("Obtain Audio Data Listing", 10, 70, 200, 25) π Local $_sSrcPath1d = GUICtrlCreateButton("Exit", 10, 100, 200, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- Global $g_sSrcPath2 ; * <---- you can use a global variable While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $_sSrcPath1a _LaunchAudioFolder() Case $_sSrcPath1b _ObtainSetName() Case $_sSrcPath1c _ObtainAudioDataListing() Case $_sSrcPath1d _ExitMe() EndSwitch WEnd Β I know that I know nothing 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