From 600481a51776f2734a4c9df88594bd3bf5ce61bd Mon Sep 17 00:00:00 2001 From: yuriy Date: Sun, 5 Nov 2023 16:21:21 -0500 Subject: [PATCH] fixed Subscribestar title and body having same formatting --- Modules/Post-To-Subscribestar.ahk | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Modules/Post-To-Subscribestar.ahk b/Modules/Post-To-Subscribestar.ahk index 55afe35..ccea754 100644 --- a/Modules/Post-To-Subscribestar.ahk +++ b/Modules/Post-To-Subscribestar.ahk @@ -125,11 +125,30 @@ if(Status){ ; Input Text into pop-up edit box SaveOrPostProgress(Message:="Inputting Post Content",PostType:="Tooltip,ErrorLoggingTextFile") -SubscribeStarJSDescription := FormatTextToJSText(PostTitleAndBody) -js = document.querySelector("trix-editor[role='textbox']").value = "%SubscribeStarJSDescription%"; -try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons. -catch e { - Message = Failed to Input Post Contents (E#8281) +; click on heading format button +Xpath = //button[@title='Heading']//i +Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) + +sleep, 500 + + +Xpath = //trix-editor[@role='textbox'] +Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle) +if(Status){ + Message = Failed to input Post Title + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") + SaveDriverURLOFErrorPage() + Return +} + +; driver.FindElementByXPath(Xpath).SendKeys(PostTitle) +sleep, 500 +driver.FindElementByXPath(Xpath).SendKeys("`n`n") +sleep, 500 + +Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostBody) +if(Status){ + Message = Failed to input Post Body SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveDriverURLOFErrorPage() Return @@ -146,7 +165,7 @@ if(!Status){ else, { ; if input successfully, post to error log String := SubStr(Status, 1, 30) Message = Post Content that got input: %String% ... - SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") }