mr-es335 Posted November 16, 2024 Posted November 16, 2024 (edited) Good day, I hope that the day finds you all very well! Would someone be so kind as to confirm the following script?: expandcollapse popup; ----------------------------------------------- #include <FileConstants.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- _SelectEdlFile() ; ----------------------------------------------- Func _SelectEdlFile() While 1 Local $sMessage = "Open Session File" Local $_SelectEdlFile = FileOpenDialog($sMessage, "C:\SAWStudio64\Audio", "Session File (*.edl)", $FD_FILEMUSTEXIST) ; ----------------------------------------------- Select Case @error = 1 MsgBox($MB_TOPMOST, "NOTICE!", "No valid Session .edl data file was selected." & @CRLF & "Please select a valid Session .edl data file") ContinueLoop Case @error <> 1 _LaunchTTA() _LaunchEdl($_SelectEdlFile) ExitLoop EndSelect WEnd EndFunc ;==>_SelectEdlFile ; ----------------------------------------------- Func _LaunchTTA() Local $_sSrcPath = "C:\Windows\toggleTaskbarAutohide.exe" ; ----------------------------------------------- Run($_sSrcPath) Sleep(100) EndFunc ;==>_LaunchTTA ; ----------------------------------------------- Func _LaunchEdl($_SelectEdlFile) Local $_sSrcPath1 = "C:\SAWStudio64\SAWStudio64.exe " ; The space here is required! Local $_sSrcPath2 = $_sSrcPath1 & $_SelectEdlFile ; ----------------------------------------------- Run($_sSrcPath2) ; ----------------- MouseMove(340, 195, 0) Sleep(2000) EndFunc ;==>_LaunchEdl ; ----------------------------------------------- Any comments and|or suggestion would be greatly appreciated. Note: If there ARE ERRORS, please just note the error and why you believe this to be so, and I will do my utmost to resolve the issue! Thank! Edited November 16, 2024 by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted November 16, 2024 Posted November 16, 2024 ; ----------------------------------------------- #include <FileConstants.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- _SelectEdlFile() ; ----------------------------------------------- Func _SelectEdlFile() While 1 Local $sMessage = "Open Session File" Local $_SelectEdlFile = FileOpenDialog($sMessage, "C:\SAWStudio64\Audio", "Session File (*.edl)", $FD_FILEMUSTEXIST) If FileExists($_SelectEdlFile) Then ExitLoop MsgBox($MB_TOPMOST, "NOTICE!", "No valid Session .edl data file was selected." & @CRLF & "Please select a valid Session .edl data file") WEnd EndFunc ;==>_SelectEdlFile ; ----------------------------------------------- Func _LaunchTTA() Local $_sSrcPath = "C:\Windows\toggleTaskbarAutohide.exe" ; ----------------------------------------------- Run("C:\Windows\toggleTaskbarAutohide.exe") Sleep(100) EndFunc ;==>_LaunchTTA ; ----------------------------------------------- Func _LaunchEdl($_SelectEdlFile) Local $_sSrcPath1 = FileGetShortName("C:\RML\SAW\SAWStudio64.exe") Local $_sSrcPath2 = $_sSrcPath1 & ' "' & $_SelectEdlFile & '"' ; to avoid problems if empty space in path ;ConsoleWrite("$_sSrcPath2: " & $_sSrcPath2 & @CRLF) ; ----------------------------------------------- Run($_sSrcPath2) ; ----------------- MouseMove(340, 195, 0) Sleep(2000) EndFunc ;==>_LaunchEdl ; ----------------------------------------------- I know that I know nothing
mr-es335 Posted November 16, 2024 Author Posted November 16, 2024 (edited) ioa747, Local $_sSrcPath1 = "C:\SAWStudio64\SAWStudio64.exe " ; The space here is required! Also, I updated the correct path: Local $_sSrcPath1 = "C:\SAWStudio64\SAWStudio64.exe" In your sampling, the Func _LaunchTTA() and Func _LaunchEdl($_SelectEdlFile) appears not to be called?! The whole point to this script is to create the following: "C:\SAWStudio64\SAWStudio64.exe C:\SAWStudio64\Audio\TestMe.edl" Edited November 16, 2024 by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted November 16, 2024 Posted November 16, 2024 (edited) 22 minutes ago, mr-es335 said: Local $_sSrcPath1 = "C:\SAWStudio64\SAWStudio64.exe " ; The space here is required! you need, but you don't necessarily need there I have put it below it's in the piece & ' "' & let ConsoleWrite tell you the path (that's why I put it there) Local $_sSrcPath1 = FileGetShortName("C:\RML\SAW\SAWStudio64.exe") Local $_sSrcPath2 = $_sSrcPath1 & ' "' & $_SelectEdlFile & '"' ; to avoid problems if empty space in path ConsoleWrite("$_sSrcPath2: " & $_sSrcPath2 & @CRLF) Edit: in _LaunchTTA() I didn't change anything, I went to remove the variable $_sSrcPath but I forgot Edited November 16, 2024 by ioa747 I know that I know nothing
mr-es335 Posted November 16, 2024 Author Posted November 16, 2024 (edited) ioa747, I had fixed the _LaunchTTA function. How are the two scripts, Func _LaunchTTA() and Func _LaunchEdl($_SelectEdlFile) being accessed? I see no Function calls to these scripts? When I launch your script, I can select an .edl, but nothing else occurs. I am not getting to each of the above two functions. So, I never see the results of ConsoleWrite?! Edited November 16, 2024 by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted November 16, 2024 Posted November 16, 2024 (edited) 1 hour ago, mr-es335 said: When I launch your script, I can select an .edl, but nothing else occurs. I am not getting to each of the above two functions. So, I never see the results of ConsoleWrite?! Sorry, it seems I forgot other things too. here's a closer look ; ----------------------------------------------- #include <FileConstants.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- _SelectEdlFile() ; ----------------------------------------------- Func _SelectEdlFile() While 1 Local $sMessage = "Open Session File" Local $_SelectEdlFile = FileOpenDialog($sMessage, "C:\SAWStudio64\Audio", "Session File (*.edl)", $FD_FILEMUSTEXIST) If FileExists($_SelectEdlFile) Then ExitLoop MsgBox($MB_TOPMOST, "NOTICE!", "No valid Session .edl data file was selected." & @CRLF & "Please select a valid Session .edl data file") WEnd _LaunchTTA() _LaunchEdl($_SelectEdlFile) EndFunc ;==>_SelectEdlFile ; ----------------------------------------------- Func _LaunchTTA() Run("C:\Windows\toggleTaskbarAutohide.exe") Sleep(100) EndFunc ;==>_LaunchTTA ; ----------------------------------------------- Func _LaunchEdl($_SelectEdlFile) Local $_sSrcPath1 = FileGetShortName("C:\RML\SAW\SAWStudio64.exe") Local $_sSrcPath2 = $_sSrcPath1 & ' "' & $_SelectEdlFile & '"' ; to avoid problems if empty space in path ConsoleWrite("$_sSrcPath2: " & $_sSrcPath2 & @CRLF) ; ----------------------------------------------- Run($_sSrcPath2) ; ----------------- MouseMove(340, 195, 0) Sleep(2000) ; Is there a reason you're waiting here? EndFunc ;==>_LaunchEdl ; ----------------------------------------------- 1 hour ago, mr-es335 said: I had fixed the _LaunchTTA function. What was it really? Did I forget something? Edited November 17, 2024 by ioa747 mr-es335 1 I know that I know nothing
mr-es335 Posted November 17, 2024 Author Posted November 17, 2024 ioa747, I see that your script is smaller than the script that I provided. May I ask if there was any "wrong" with my script? mr-es335 Sentinel Music Studios
ioa747 Posted November 17, 2024 Posted November 17, 2024 17 minutes ago, mr-es335 said: May I ask if there was any "wrong" with my script? error I can't say it has, only the omission that it doesn't foresee the spaces in the path of the files. The other is the approach you had in the _SelectEdlFile() function. Case @error = 1 Case @error <> 1 (What do you do in case @error =2 ?) and from the description you have in MsgBox, the approach fits best if the file exists in my opinion 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