Added a couple more error checks to Chrome Tab switching function

main
Yuriy 2 years ago
parent 6f2bc24753
commit 8b23cee3e9

@ -40,7 +40,7 @@ global UpdateVersionNumber
ScriptName = Freedomain Social Media Poster ScriptName = Freedomain Social Media Poster
ScriptVersion = 2.75 ScriptVersion = 2.76
FullScriptName := ScriptName . " " . ScriptVersion FullScriptName := ScriptName . " " . ScriptVersion
;---ToDo--- ;---ToDo---
@ -1561,6 +1561,8 @@ Return
;---------------/Facebook---------------------------------- ;---------------/Facebook----------------------------------
/*
*/
; -------------------------------Parler------------------------------- ; -------------------------------Parler-------------------------------
PostToParler: PostToParler:
@ -1887,7 +1889,8 @@ if(ImageAttachmentFilepath != ""){
Return Return
; -------------------------------/SubScribeStar------------------------------- ; -------------------------------/SubScribeStar-------------------------------
/*
*/
; -------------------------------LinkedIn------------------------------- ; -------------------------------LinkedIn-------------------------------
PostToLinkedIN: PostToLinkedIN:
@ -2118,6 +2121,8 @@ if(ImageAttachmentFilepath != ""){
Return Return
; -------------------------------/LinkedIn------------------------------- ; -------------------------------/LinkedIn-------------------------------
/*
*/
; -------------------------------Minds------------------------------- ; -------------------------------Minds-------------------------------
PostToMinds: PostToMinds:
@ -2261,13 +2266,14 @@ if(ImageAttachmentFilepath != ""){
Return Return
} }
} }
} else, { ; otherwise, input just text }
else, { ; otherwise, input just text
SaveOrPostProgress(Message:="Inputting Text Post",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Inputting Text Post",PostType:="Tooltip,ErrorLoggingTextFile")
; DevModeMsgBox("Inputting Text Post") ; DevModeMsgBox("Inputting Text Post")
Xpath = //textarea[@id='minds-m-composer__textarea--1003'] Xpath = //textarea[@id='minds-m-composer__textarea--1003']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody) Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
DevModeMsgBox("done")
if(Status){ if(Status){
Message = Failed to post with Xpath, trying with ID Message = Failed to post with Xpath, trying with ID
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -2305,7 +2311,8 @@ if(ImageAttachmentFilepath != ""){
js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click(); js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click();
try status := driver.executeScript(js) try status := driver.executeScript(js)
catch e { catch e {
Msgbox % "status: " status Message = Clicking submit button with JS resulted in status: %status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
} }
@ -2361,6 +2368,9 @@ if(ImageAttachmentFilepath != ""){
Return Return
; -------------------------------/Minds------------------------------- ; -------------------------------/Minds-------------------------------
/*
*/
; -------------------------------Locals------------------------------- ; -------------------------------Locals-------------------------------
PostToLocals: PostToLocals:
CurrentSite := "Locals" CurrentSite := "Locals"
@ -2368,9 +2378,15 @@ if(ImageAttachmentFilepath != ""){
; @todo: Add auto-login to locals ; @todo: Add auto-login to locals
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space%
Message = LocalsURL from Ini File: %LocalsURL% if(LocalsURL = ""){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Message = LocalsURL from Ini File: %LocalsURL%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; LocalsURL := StrReplace(Localsurl, "/share/post", "") ; LocalsURL := StrReplace(Localsurl, "/share/post", "")
; LocalsURL := Localsurl . "/login" ; LocalsURL := Localsurl . "/login"

@ -1 +1 @@
Subproject commit f056489f509d570de33c67e023e3edc5296fe3ac Subproject commit 8a4c74ffafc09cdc5c7eebca06e4e9da2a71e79c
Loading…
Cancel
Save