Compare commits
15 Commits
8395c5c367
...
a3d89a9892
| Author | SHA1 | Date | |
|---|---|---|---|
| a3d89a9892 | |||
| a5bc6225b6 | |||
| 4ac3c76641 | |||
| 96a8fb9566 | |||
| cf56ae8136 | |||
| 738e1af443 | |||
| f71def4542 | |||
| 20c2f44b0c | |||
| 997ee862ed | |||
| b378de8106 | |||
| ed307493b8 | |||
| 2860e4868f | |||
| 0e02ae24bd | |||
| b19482e10d | |||
| d7d3ce039f |
BIN
Assets/Icon.png
Normal file
BIN
Assets/Icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
Assets/Icon.xcf
Normal file
BIN
Assets/Icon.xcf
Normal file
Binary file not shown.
BIN
Assets/Share.png
Normal file
BIN
Assets/Share.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -128,6 +128,7 @@ DownloadLatestChromium(){
|
|||||||
IfMsgBox OK, {
|
IfMsgBox OK, {
|
||||||
|
|
||||||
} Else IfMsgBox Cancel, {
|
} Else IfMsgBox Cancel, {
|
||||||
|
ToolTip
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,6 +154,7 @@ DownloadLatestChromium(){
|
|||||||
|
|
||||||
Process, Close, chromedriver.exe
|
Process, Close, chromedriver.exe
|
||||||
sleep, 5000 ; wait 5 seconds before checking again
|
sleep, 5000 ; wait 5 seconds before checking again
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
else,
|
else,
|
||||||
break
|
break
|
||||||
@@ -309,144 +311,138 @@ DownloadLatestChromium(){
|
|||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
MsgBox 0x40,, %Message%
|
MsgBox 0x40,, %Message%
|
||||||
|
|
||||||
|
ChromeFilepath := ; clear out chromefilepath variable in case the path changed
|
||||||
|
|
||||||
ToolTip
|
ToolTip
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
CheckForChromeUpdates(ChromeFilepath := ""){
|
||||||
|
if(ChromeFilepath = "")
|
||||||
|
ChromeFilepath := GetInstalledChromeFilepath()
|
||||||
|
|
||||||
CheckForChromeUpdates(ChromeFilepath := ""){
|
CurrentInstalledChromeVersion := GetInstalledChromeVersion()
|
||||||
if(ChromeFilepath = "")
|
CurrentChromeStableVersion := GetLatestChromeStableVersion()
|
||||||
ChromeFilepath := GetInstalledChromeFilepath()
|
|
||||||
|
|
||||||
CurrentInstalledChromeVersion := GetInstalledChromeVersion()
|
if(CurrentInstalledChromeVersion < CurrentChromeStableVersion){
|
||||||
CurrentChromeStableVersion := GetLatestChromeStableVersion()
|
ChromeUpdateAvailable := 1
|
||||||
|
return ChromeUpdateAvailable
|
||||||
|
}
|
||||||
|
else, Return 0
|
||||||
|
|
||||||
if(CurrentInstalledChromeVersion < CurrentChromeStableVersion){
|
|
||||||
ChromeUpdateAvailable := 1
|
}
|
||||||
return ChromeUpdateAvailable
|
|
||||||
|
|
||||||
|
GetInstalledChromeFilepath(){
|
||||||
|
; ChromeFilepath is global variable
|
||||||
|
if(ChromeFilepath = ""){
|
||||||
|
|
||||||
|
ChromePortableFilepath = %A_ScriptDir%\Lib\chrome-win64\chrome.exe
|
||||||
|
ChromePortableFilepath2 = %A_ScriptDir%\Lib\chrome-win64\chrome-win64\chrome.exe ; filepath of chrome.exe that was downloaded automatically using this uploader
|
||||||
|
|
||||||
|
if(FileExist(ChromePortableFilepath) or FileExist(ChromePortableFilepath2)){
|
||||||
|
if(FileExist(ChromePortableFilepath2))
|
||||||
|
ChromeFilepath := ChromePortableFilepath2
|
||||||
|
|
||||||
|
if(FileExist(ChromePortableFilepath))
|
||||||
|
ChromeFilepath := ChromePortableFilepath
|
||||||
|
|
||||||
|
Message = Using Chromium Portable for Upload
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
}
|
}
|
||||||
else, Return 0
|
else {
|
||||||
|
MsgBox 0x10, Chrome Not Found, Chrome for Testing not found.`nIf this is your first time running on this computer, please click the "Chrome Up-To-Date" button to download the latest chrome binaries.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ToolTip
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GetInstalledChromeVersion(){
|
||||||
|
|
||||||
|
if(ChromeFilepath = ""){
|
||||||
|
GetInstalledChromeFilepath()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetInstalledChromeVersionCommand = powershell (Get-Item '%ChromeFilepath%').VersionInfo.ProductVersion
|
||||||
|
InstalledChromeVersion := RunCMD(GetInstalledChromeVersionCommand)
|
||||||
|
|
||||||
GetInstalledChromeFilepath(){
|
if(InStr(InstalledChromeVersion, "`r"))
|
||||||
; ChromeFilepath is global variable
|
InstalledChromeVersion := StrReplace(InstalledChromeVersion, "`r") ; replace any newline characters that powershell returns
|
||||||
|
|
||||||
if(ChromeFilepath = ""){
|
return InstalledChromeVersion
|
||||||
|
}
|
||||||
ChromePortableFilepath = %A_ScriptDir%\Lib\chrome-win64\chrome.exe
|
|
||||||
ChromePortableFilepath2 = %A_ScriptDir%\Lib\chrome-win64\chrome-win64\chrome.exe ; filepath of chrome.exe that was downloaded automatically using this uploader
|
|
||||||
|
|
||||||
if(FileExist(ChromePortableFilepath) or FileExist(ChromePortableFilepath2)){
|
|
||||||
if(FileExist(ChromePortableFilepath2))
|
|
||||||
ChromeFilepath := ChromePortableFilepath2
|
|
||||||
|
|
||||||
if(FileExist(ChromePortableFilepath))
|
|
||||||
ChromeFilepath := ChromePortableFilepath
|
|
||||||
|
|
||||||
Message = Using Chromium Portable for Upload
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
MsgBox 0x10, Chromium Portable not Found, Chromium Portable not found. `nPlease make sure it's located at one of the following paths and then try again.`n`n%ChromePortableFilepath% `nOR`n%ChromePortableFilepath2%
|
|
||||||
|
|
||||||
|
|
||||||
; Leave this in for now, but i don't think we will be going to using the system Chrome in the future.
|
GetLatestChromeStableVersion(){
|
||||||
; if(FileExist("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"))
|
|
||||||
; ChromeFilepath = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
|
|
||||||
|
|
||||||
; if(FileExist("C:\Program Files\Google\Chrome\Application\chrome.exe"))
|
; https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints
|
||||||
; ChromeFilepath = C:\Program Files\Google\Chrome\Application\chrome.exe
|
json_str := urldownloadtovar("https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json")
|
||||||
}
|
|
||||||
}
|
|
||||||
ToolTip
|
|
||||||
|
|
||||||
|
|
||||||
|
; converts json data variable into object
|
||||||
|
parsed := JSON.Load(json_str)
|
||||||
|
|
||||||
|
|
||||||
|
try ChromeStableLatestVersion := parsed.channels.stable.version
|
||||||
|
|
||||||
|
if(ChromeStableLatestVersion = ""){
|
||||||
|
return "Failed to parse json. "
|
||||||
}
|
}
|
||||||
|
|
||||||
GetInstalledChromeVersion(){
|
return ChromeStableLatestVersion
|
||||||
|
}
|
||||||
|
|
||||||
if(ChromeFilepath = ""){
|
|
||||||
GetInstalledChromeFilepath()
|
|
||||||
}
|
|
||||||
|
|
||||||
GetInstalledChromeVersionCommand = powershell (Get-Item '%ChromeFilepath%').VersionInfo.ProductVersion
|
GetDownloadURLOfChromeAndDriver(InstalledChromeVersion){
|
||||||
InstalledChromeVersion := RunCMD(GetInstalledChromeVersionCommand)
|
; Will return the download URL of Chrome for Testing and Chrome Driver, seperated by a ||
|
||||||
|
|
||||||
if(InStr(InstalledChromeVersion, "`r"))
|
; https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints
|
||||||
InstalledChromeVersion := StrReplace(InstalledChromeVersion, "`r") ; replace any newline characters that powershell returns
|
json_str := urldownloadtovar("https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json")
|
||||||
|
|
||||||
return InstalledChromeVersion
|
; requires #include of json.ahk in parent script
|
||||||
|
parsed := JSON.Load(json_str)
|
||||||
|
|
||||||
|
ChromelabsJsonEntriesCount := parsed.versions.count()
|
||||||
|
|
||||||
|
if(ChromelabsJsonEntriesCount = ""){
|
||||||
|
return "Failed to parse chromedriver json. "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loop % ChromelabsJsonEntriesCount {
|
||||||
|
|
||||||
GetLatestChromeStableVersion(){
|
if(A_index = ChromelabsJsonEntriesCount){
|
||||||
|
Message = "Failed to find %InstalledChromeVersion% in the ChromeLabs Json"
|
||||||
; https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints
|
return Message
|
||||||
json_str := urldownloadtovar("https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json")
|
|
||||||
|
|
||||||
|
|
||||||
; converts json data variable into object
|
|
||||||
parsed := JSON.Load(json_str)
|
|
||||||
|
|
||||||
|
|
||||||
try ChromeStableLatestVersion := parsed.channels.stable.version
|
|
||||||
|
|
||||||
if(ChromeStableLatestVersion = ""){
|
|
||||||
return "Failed to parse json. "
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ChromeStableLatestVersion
|
if(InstalledChromeVersion = parsed.versions[A_Index].version){
|
||||||
|
|
||||||
|
VersionIndex := A_Index
|
||||||
|
|
||||||
|
; loop through the platforms to get download URL for Chrome
|
||||||
|
loop % parsed.versions[VersionIndex].downloads.chrome.count() {
|
||||||
|
|
||||||
|
if(parsed.versions[VersionIndex].downloads.chrome[A_Index].platform = "win64")
|
||||||
|
chromeDLURL64 := parsed.versions[VersionIndex].downloads.chrome[A_Index].url
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; loop through the platforms to get download URL for Chromedriver
|
||||||
|
loop % parsed.versions[VersionIndex].downloads.chromedriver.count() {
|
||||||
|
|
||||||
|
if(parsed.versions[VersionIndex].downloads.chromedriver[A_Index].platform = "win64")
|
||||||
|
chromedriverDLURL64 := parsed.versions[VersionIndex].downloads.chromedriver[A_Index].url
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
URLS = %chromeDLURL64%||%chromedriverDLURL64%
|
||||||
GetDownloadURLOfChromeAndDriver(InstalledChromeVersion){
|
return URLS
|
||||||
; Will return the download URL of Chrome for Testing and Chrome Driver, seperated by a ||
|
}
|
||||||
|
|
||||||
; https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints
|
|
||||||
json_str := urldownloadtovar("https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json")
|
|
||||||
|
|
||||||
; requires #include of json.ahk in parent script
|
|
||||||
parsed := JSON.Load(json_str)
|
|
||||||
|
|
||||||
ChromelabsJsonEntriesCount := parsed.versions.count()
|
|
||||||
|
|
||||||
if(ChromelabsJsonEntriesCount = ""){
|
|
||||||
return "Failed to parse chromedriver json. "
|
|
||||||
}
|
|
||||||
|
|
||||||
loop % ChromelabsJsonEntriesCount {
|
|
||||||
|
|
||||||
if(A_index = ChromelabsJsonEntriesCount){
|
|
||||||
Message = "Failed to find %InstalledChromeVersion% in the ChromeLabs Json"
|
|
||||||
return Message
|
|
||||||
}
|
|
||||||
|
|
||||||
if(InstalledChromeVersion = parsed.versions[A_Index].version){
|
|
||||||
|
|
||||||
VersionIndex := A_Index
|
|
||||||
|
|
||||||
; loop through the platforms to get download URL for Chrome
|
|
||||||
loop % parsed.versions[VersionIndex].downloads.chrome.count() {
|
|
||||||
|
|
||||||
if(parsed.versions[VersionIndex].downloads.chrome[A_Index].platform = "win64")
|
|
||||||
chromeDLURL64 := parsed.versions[VersionIndex].downloads.chrome[A_Index].url
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
; loop through the platforms to get download URL for Chromedriver
|
|
||||||
loop % parsed.versions[VersionIndex].downloads.chromedriver.count() {
|
|
||||||
|
|
||||||
if(parsed.versions[VersionIndex].downloads.chromedriver[A_Index].platform = "win64")
|
|
||||||
chromedriverDLURL64 := parsed.versions[VersionIndex].downloads.chromedriver[A_Index].url
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
URLS = %chromeDLURL64%||%chromedriverDLURL64%
|
|
||||||
return URLS
|
|
||||||
}
|
|
||||||
@@ -137,6 +137,10 @@ CheckDirExistAndCreate(Path){
|
|||||||
; -------------------------------/CheckDirExistAndCreate-------------------------------
|
; -------------------------------/CheckDirExistAndCreate-------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
; Script Updates
|
||||||
|
; ------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CheckIfUpdateAvailable(Filepath, CurrentVersion){
|
CheckIfUpdateAvailable(Filepath, CurrentVersion){
|
||||||
FileRead, ScriptUpdateContents, %Filepath%
|
FileRead, ScriptUpdateContents, %Filepath%
|
||||||
@@ -605,6 +609,33 @@ GetDateOrdinalSuffix(D) {
|
|||||||
|
|
||||||
; OnMsgbox - Custom Msgbox Screens
|
; OnMsgbox - Custom Msgbox Screens
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
|
|
||||||
|
ConfirmBeforeSubmitMsgboxFunc(){
|
||||||
|
/*
|
||||||
|
; Snippet to for check:
|
||||||
|
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||||
|
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||||
|
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
OnMessage(0x44, "OnMsgBoxUserConfirmation")
|
||||||
|
MsgBox 0x21, User Confirmation, Please check that all data was input correctly and fix any mistakes and then click PROCEED to finalize the Upload.`n`nClick STOP to cancel the rest of this Upload and move on to the next website.
|
||||||
|
OnMessage(0x44, "")
|
||||||
|
IfMsgBox OK, {
|
||||||
|
return true
|
||||||
|
} Else IfMsgBox Cancel, {
|
||||||
|
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||||
|
Return %Message%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OnMsgBoxUpdateAvailable() {
|
OnMsgBoxUpdateAvailable() {
|
||||||
DetectHiddenWindows, On
|
DetectHiddenWindows, On
|
||||||
Process, Exist
|
Process, Exist
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
Function Libraries used in the following Projects:
|
Function Libraries used in the following Projects:
|
||||||
- [Freedomain Social Media Poster](https://freedomain.dev/yuriy/social-media-poster)
|
- [Freedomain Social Media Poster](https://freedomain.dev/yuriy/social-media-poster)
|
||||||
- [Freedomain Video Uploader](https://freedomain.dev/yuriy/video-uploader)
|
- [Freedomain Video Uploader](https://freedomain.dev/yuriy/video-uploader)
|
||||||
|
- [Freedomain Clips Uploader](https://freedomain.dev/yuriy/clips-uploader)
|
||||||
|
- [Freedomain Livestream Scheduler](https://freedomain.dev/yuriy/livestream-scheduler)
|
||||||
@@ -721,21 +721,27 @@ Selenium_LoopToSendValueByName(ElementName,NumOfLoops:=1,SleepLength:=1000,Strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:="",ClearElement:=0){
|
Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:="",ClearElement:=0){
|
||||||
; Msgbox % "StringTextContent: " StringTextContent
|
|
||||||
; Msgbox % "ClearElement: " ClearElement
|
|
||||||
|
|
||||||
loop, %NumOfLoops% {
|
loop, %NumOfLoops% {
|
||||||
; msgbox % ClearElement
|
|
||||||
if(ClearElement){
|
if(ClearElement){
|
||||||
Loop, 3 { ; have to do it multiple times to make it trigger properly
|
Loop, 3 { ; sometimes have to do it multiple times to make it trigger properly
|
||||||
|
Try PreviousValue := driver.findelementbyxpath(Xpath).Attribute("value") ;Xpath Value
|
||||||
|
|
||||||
try, driver.FindElementByXPath(Xpath).clear()
|
try, driver.FindElementByXPath(Xpath).clear()
|
||||||
sleep, 500
|
|
||||||
|
Try CurrentValue := driver.findelementbyxpath(Xpath).Attribute("value") ;Xpath Value
|
||||||
|
|
||||||
|
if(PreviousValue != CurrentValue){
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
sleep, 1000
|
||||||
|
; msgbox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try driver.FindElementByXPath(Xpath).sendKeys(StringTextContent) ; Input Text
|
||||||
; ToolTip, Loop attempt: %A_index%
|
|
||||||
try driver.FindElementByXPath(Xpath).sendKeys(StringTextContent) ; Click on "upload image" button
|
|
||||||
catch e {
|
catch e {
|
||||||
if(A_index = NumOfLoops){
|
if(A_index = NumOfLoops){
|
||||||
Return "Failed"
|
Return "Failed"
|
||||||
@@ -790,17 +796,27 @@ Selenium_LoopToClickXpathAndWaitForOpenWindow(Xpath,NumOfLoops:=1,SleepLength:=1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Selenium_LoopToClearXpath(Xpath,NumOfLoops:=1,SleepLength:=1000){
|
Selenium_LoopToClearXpath(Xpath,NumberOfAttemps:=1,SleepLength:=1000){
|
||||||
loop, %NumOfLoops% {
|
loop, %NumberOfAttemps% {
|
||||||
|
|
||||||
try driver.FindElementByXPath(Xpath).clear()
|
try driver.FindElementByXPath(Xpath).clear()
|
||||||
catch e {
|
catch e {
|
||||||
if(A_index = NumOfLoops){
|
Return "Failed"
|
||||||
Return "Failed"
|
|
||||||
}
|
|
||||||
sleep, %SleepLength%
|
|
||||||
Continue
|
|
||||||
}
|
}
|
||||||
Return
|
|
||||||
|
sleep, %SleepLength%
|
||||||
|
|
||||||
|
try, InerText := driver.findelementbyxpath(Xpath).Attribute("value")
|
||||||
|
; Msgbox % "InerText: " InerText
|
||||||
|
if(InerText = "")
|
||||||
|
return
|
||||||
|
|
||||||
|
if(A_index = NumberOfAttemps){
|
||||||
|
return "Failed after %NumberOfAttemps"
|
||||||
|
}
|
||||||
|
|
||||||
|
Continue
|
||||||
|
; Return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -834,26 +850,26 @@ SaveDriverURLOFErrorPage(){ ; save the url of the result page. That way if a tab
|
|||||||
|
|
||||||
GetHTMLValueFromXpathOuterHTML(XPATH, HTMLElementName){
|
GetHTMLValueFromXpathOuterHTML(XPATH, HTMLElementName){
|
||||||
|
|
||||||
Try ElementOuterHTML := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
|
Try ElementOuterHTML := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
|
||||||
; try Clipboard := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
|
; try Clipboard := driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
|
||||||
; Try MsgBox,,Element OuterHTML: `n, % driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
|
; Try MsgBox,,Element OuterHTML: `n, % driver.findelementbyxpath(Xpath).Attribute("outerHTML") ;XPATH-ID & Tag
|
||||||
|
|
||||||
; Match string between quotes following the HTMLELEMENTNAME
|
; Match string between quotes following the HTMLELEMENTNAME
|
||||||
RegexStatement = %HTMLElementName%="([^"]+)"
|
RegexStatement = %HTMLElementName%="([^"]+)"
|
||||||
|
|
||||||
; regexMatch := RegExMatch(ElementOuterHTML, "value=""([^""]+)""", match)
|
; regexMatch := RegExMatch(ElementOuterHTML, "value=""([^""]+)""", match)
|
||||||
regexMatch := RegExMatch(ElementOuterHTML, RegexStatement, match)
|
regexMatch := RegExMatch(ElementOuterHTML, RegexStatement, match)
|
||||||
if (regexMatch)
|
if (regexMatch)
|
||||||
{
|
{
|
||||||
ElementValue := match1
|
ElementValue := match1
|
||||||
; Msgbox % "PostURL: " PostURL
|
; Msgbox % "PostURL: " PostURL
|
||||||
; Message = URL Pulled out from OuterHTML: %PostURL%
|
; Message = URL Pulled out from OuterHTML: %PostURL%
|
||||||
Return ElementValue
|
Return ElementValue
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Message = Failed to Pull out value from OuterHTML
|
Message = Failed to Pull out value from OuterHTML
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
Return "Failed"
|
Return "Failed"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
105
Shared-GoTos.ahk
Normal file
105
Shared-GoTos.ahk
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
; This #include needs to be at the bottom of the parent script
|
||||||
|
|
||||||
|
|
||||||
|
CheckForUpdates:
|
||||||
|
; The GUI buttons must have variable set to vUpdateAvailable and vChromeUpdateAvailable for button to get updated
|
||||||
|
|
||||||
|
; The following variables need to be set in the parent script
|
||||||
|
; GitReleasesAPIURL
|
||||||
|
; ChromeFilepath
|
||||||
|
|
||||||
|
; Message = Checking for Updates
|
||||||
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
|
||||||
|
if(CheckForUpdates(GitReleasesAPIURL)){
|
||||||
|
GuiControl,,UpdateAvailable, %ScriptAbbreviatedName% Update Available!
|
||||||
|
}
|
||||||
|
|
||||||
|
if(CheckForChromeUpdates(ChromeFilepath)){
|
||||||
|
GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
|
||||||
|
; ChromeUpdateAvailable := 1
|
||||||
|
}
|
||||||
|
ToolTip
|
||||||
|
Return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
UpdateChrome:
|
||||||
|
|
||||||
|
; if chroem doesn't exist, download it
|
||||||
|
if(ChromeFilepath = ""){
|
||||||
|
Status := DownloadLatestChromium()
|
||||||
|
if(Status)
|
||||||
|
GuiControl,,ChromeUpdateAvailable, Chrome Up-To-Date
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(CheckForChromeUpdates = "")
|
||||||
|
Status := CheckForChromeUpdates(ChromeFilepath)
|
||||||
|
|
||||||
|
if(!status){
|
||||||
|
OnMessage(0x44, "OnMsgBoxConfirmChromiumOverwrite")
|
||||||
|
MsgBox 0x41, Already Up-to-Date, Yor current Chromium version is already up to date. `nDo you want to download and overwrite it?
|
||||||
|
OnMessage(0x44, "")
|
||||||
|
|
||||||
|
IfMsgBox OK, {
|
||||||
|
Return
|
||||||
|
} Else IfMsgBox Cancel, {
|
||||||
|
ToolTip
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Status := DownloadLatestChromium()
|
||||||
|
if(Status)
|
||||||
|
GuiControl,,ChromeUpdateAvailable, Chrome Up-To-Date
|
||||||
|
|
||||||
|
Return
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PasteClipboardToEditBox:
|
||||||
|
if(A_GuiControl = "PasteClipboardToSMPBody"){
|
||||||
|
GuiControl,,PostBody, %Clipboard%
|
||||||
|
}
|
||||||
|
|
||||||
|
if(A_GuiControl = "PasteClipboardToSMPTitle"){
|
||||||
|
GuiControl,,PostTitle, %Clipboard%
|
||||||
|
}
|
||||||
|
|
||||||
|
if(A_GuiControl = "PasteClipboardToFLSTitle"){
|
||||||
|
GuiControl,,LivestreamTitle, %Clipboard%
|
||||||
|
}
|
||||||
|
|
||||||
|
if(A_GuiControl = "PasteClipboardToFLSDescription"){
|
||||||
|
GuiControl,,LivestreamDescription, %Clipboard%
|
||||||
|
}
|
||||||
|
|
||||||
|
if(A_GuiControl = "PasteClipboardToFLSTags"){
|
||||||
|
GuiControl,,LivestreamTags, %Clipboard%
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Return
|
||||||
|
|
||||||
|
OpenErrorLog:
|
||||||
|
run, %ErrorLoggingFilePath%
|
||||||
|
Return
|
||||||
|
|
||||||
|
OpenGiteaPage:
|
||||||
|
if(ScriptAbbreviatedName = "FLS")
|
||||||
|
URL = https://freedomain.dev/yuriy/livestream-scheduler
|
||||||
|
|
||||||
|
if(ScriptAbbreviatedName = "FVU")
|
||||||
|
URL = https://freedomain.dev/yuriy/video-uploader
|
||||||
|
|
||||||
|
if(ScriptAbbreviatedName = "FSMP")
|
||||||
|
URL = https://freedomain.dev/yuriy/social-media-poster
|
||||||
|
|
||||||
|
|
||||||
|
run, %URL%
|
||||||
|
Return
|
||||||
1
Update-Functions.ahk
Normal file
1
Update-Functions.ahk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
; Code migrated to Shared-GoTo's
|
||||||
Reference in New Issue
Block a user