Compare commits

...

4 Commits

Author SHA1 Message Date
124a26c3b0 fixed broken function, bit o' organization 2024-05-04 14:55:54 -04:00
b5c3b4a606 error checkign and general msgbox window 2024-05-03 12:52:49 -04:00
Yuriy
43dd2c3f28 expanded function 2024-05-02 00:29:19 -04:00
Yuriy
88c48e133e expanded function 2024-05-02 00:29:11 -04:00
2 changed files with 69 additions and 42 deletions

View File

@@ -375,19 +375,6 @@ Return Var
} }
; OnMsgbox Functions
;------------------------------------------------
OnMsgBoxUpdateAvailable() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel
ControlSetText Button2, Install
}
}
SaveCurrentChromeVersionToIniFile(){ SaveCurrentChromeVersionToIniFile(){
if(InstalledChromeVersion = "") if(InstalledChromeVersion = "")
@@ -427,14 +414,7 @@ HasSubstringVal(haystack, needle)
; -------------------------------Functions------------------------------- ; -------------------------------Functions-------------------------------
OnMsgBoxConfirmChromiumOverwrite() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel
ControlSetText Button2, Yes
}
}
; https://www.autohotkey.com/docs/v2/Functions.htm#Variadic ; https://www.autohotkey.com/docs/v2/Functions.htm#Variadic
Join(sep, params*) { Join(sep, params*) {
@@ -477,23 +457,6 @@ AddToTotalVideosUploadedCount(){
OnMsgBoxPodcastFinish() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
WinMove,, 0
}
}
OnMsgBoxSocialMediaPoster() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Yes
ControlSetText Button2, Not Now
}
}
Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){ Check_For_Stuck_Video_Upload(Index_Number, Upload_Status){
@@ -616,8 +579,6 @@ CreateErrorLoggingFiles(Directory := ""){
} }
; if passed argument is .exe file, then script has just been updated and we need to delete the old .exe file ; if passed argument is .exe file, then script has just been updated and we need to delete the old .exe file
CheckIfUpdateInstalled(PassedInArgument :=""){ CheckIfUpdateInstalled(PassedInArgument :=""){
@@ -632,3 +593,57 @@ CheckIfUpdateInstalled(PassedInArgument :=""){
} }
} }
; OnMsgbox - Custom Msgbox Screens
;------------------------------------------------
OnMsgBoxUpdateAvailable() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel
ControlSetText Button2, Install
}
}
; Show a user confirmation msgbox with a PROCEED and STOP buttons
; Used by the "Confirm before Submit" checkbox
OnMsgBoxUserConfirmation() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, PROCEED
ControlSetText Button2, STOP
}
}
OnMsgBoxConfirmChromiumOverwrite() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Cancel
ControlSetText Button2, Yes
}
}
OnMsgBoxPodcastFinish() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
WinMove,, 0
}
}
OnMsgBoxSocialMediaPoster() {
DetectHiddenWindows, On
Process, Exist
If (WinExist("ahk_class #32770 ahk_pid " . ErrorLevel)) {
ControlSetText Button1, Yes
ControlSetText Button2, Not Now
}
}

View File

@@ -720,8 +720,20 @@ Selenium_LoopToSendValueByName(ElementName,NumOfLoops:=1,SleepLength:=1000,Strin
} }
} }
Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:=""){ Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:="",ClearElement:=0){
; Msgbox % "StringTextContent: " StringTextContent
; Msgbox % "ClearElement: " ClearElement
loop, %NumOfLoops% { loop, %NumOfLoops% {
; msgbox % ClearElement
if(ClearElement){
Loop, 3 { ; have to do it multiple times to make it trigger properly
try, driver.FindElementByXPath(Xpath).clear()
sleep, 500
}
}
; ToolTip, Loop attempt: %A_index% ; ToolTip, Loop attempt: %A_index%
try driver.FindElementByXPath(Xpath).sendKeys(StringTextContent) ; Click on "upload image" button try driver.FindElementByXPath(Xpath).sendKeys(StringTextContent) ; Click on "upload image" button
catch e { catch e {