Code: Select all
; Auto Unarchive on ArchiveOne
; Ver 0.1
; By iguru42
;
;Ver 0.1 notes
; Initial attempt to modify journal archive script to do unarchive instead.
; It must be run with admin priviliges, right click and run as admin.
; Just TAB will move between some frames of ArchiveOne Admin
;
;Notes: command hotkeys I always forget !=alt, ^=ctrl, +=shift, #=windows, *=wildcard
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode 2
#SingleInstance Force
#Persistent
DetectHiddenWindows, On
DetectHiddenText, On
SetTitleMatchMode Slow
CoordMode,mouse,window
count=1
Loop
{
filedelete, status.txt
Sleep 3000
SS("Script Started")
RA()
SS("Unarchive Process running, waiting for completion")
WFC()
SS("Unarchive complete, iterating by 1 and starting from beginning")
count++
}
;FUNCTIONS
RA() { ;Run Unarchive
send unarchive test
send !ae
sleep 1000
send !wb
sleep 1000
click 293,138
send !r
sleep 1000
send {tab 3}
sleep 1000
send {down %count%}
;the 3 lines below this are commented out for testing purposes.
;send !a
;send {enter 3}
;send !ar{enter}
}
SS(TTS) { ;Send text to file name status in the current folder
FormatTime, timestamp,, HH:mm:ss
fileappend, %timestamp% : %tts%`r`n, status.txt
}
SHours(sleephours) { ;Sleep for X number of hours.
loop, % sleephours
{
FormatTime, timestamp,, HH:mm:ss
fileappend, %timestamp% : Pausing for 1 hour`r`n, status.txt
loop, 60
{
mousemove, 1, 0, 0, R
sleep 30000
mousemove, -1, 0, 0, R
sleep 30000
}
}
}
WFC() { ; Wait for completed, check the Policy Status window for both Phase buttons to be greyed out, when found exit loop.
loop
{
mousemove, 1, 0, 0, R
sleep 5000
mousemove, -1, 0, 0, R
sleep 5000
ImageSearch, FoundX, FoundY, 0,0,1999,1999, *50 sconsole.png
sleep 10000
if ErrorLevel = 0
break
}
sleep 1000
send +{tab 3}{enter}
sleep 5000
}