From 263fb222e93f6f539bde72cc38be873a90ac765e Mon Sep 17 00:00:00 2001 From: yuriy Date: Thu, 21 Sep 2023 20:50:06 -0400 Subject: [PATCH] fixed GUI giving error if iniread xposition and yposition doesn't work, wav filepath will check for a FLAC file first and then .wav if not found --- Freedomain Video Uploader.ahk | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Freedomain Video Uploader.ahk b/Freedomain Video Uploader.ahk index 01ea820..def2c62 100644 --- a/Freedomain Video Uploader.ahk +++ b/Freedomain Video Uploader.ahk @@ -139,8 +139,8 @@ ScriptSettingsSection := "VideoUploader" IniRead, ShowTooltipProgress, %SettingsIniFilepath%, General, ShowTooltipProgress, 1 (ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0) -IniRead, XPosition, %SettingsIniFilepath%, General, XPosition -IniRead, YPosition, %SettingsIniFilepath%, General, YPosition +IniRead, XPosition, %SettingsIniFilepath%, General, XPosition, 0 +IniRead, YPosition, %SettingsIniFilepath%, General, YPosition, 0 IniRead, RootDirToStartIn, %SettingsIniFilepath%, General, RootDirToStartIn IniRead, LogErrorsToMsgbox, %SettingsIniFilepath%, General, LogErrorsToMsgbox, %A_Space% @@ -313,7 +313,7 @@ if(VideoDescription = ""){ } ; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise. -Loop, files, %VideoFolderDir%\*.WAV, F ; loop through the files in the directory +Loop, files, %VideoFolderDir%\*.flac, F ; loop through the files in the directory { ; D = Directories, F = Files, R = Recursive SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt @@ -322,7 +322,21 @@ Loop, files, %VideoFolderDir%\*.WAV, F ; loop through the files in the direct } } -; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise. +; if no FLAC file, then loop through folder and select WAV file instead +if(WavAudioFilepath = ""){ + ; Loop through the folder again to find the correct .WAV audio file as Stef has multiple in there and we need the .mp4 file to be found first so we know what to look for file name wise. + Loop, files, %VideoFolderDir%\*.WAV, F ; loop through the files in the directory + { ; D = Directories, F = Files, R = Recursive + SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt + + if(FileNameNoExt = VideoFileNameNoExt){ + WavAudioFilepath := A_LoopFileFullPath + } + } +} + + +; Find the .mp3 podcast file Loop, files, %VideoFolderDir%\*.mp3, F ; loop through the files in the directory { ; D = Directories, F = Files, R = Recursive SplitPath, A_LoopFileFullPath, FileNameWExt, FileDir, FileExt, FileNameNoExt @@ -1239,6 +1253,20 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,Disc DisplayResults: +WinGetPos, XPosition, YPosition, , , A + +if(XPosition > 0 and YPosition > 0){ ; if gui doesn't exist, both are set to -8 +; Msgbox % "XPosition: " XPosition +; Msgbox % "YPosition: " YPosition +IniWrite, %XPosition%, %SettingsIniFilepath%, General, XPosition +IniWrite, %YPosition%, %SettingsIniFilepath%, General, YPosition + +} + + + + + Tooltip ; Remove all tooltips Gui, Destroy ; destroy GUI in case we're going from the main screen to results without uploading.