Code: Select all
#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.
BlockInput, Off
SetControlDelay -1
SetKeyDelay, 10, 10
SetWinDelay, 1000
DetectHiddenText, On
winName:="Esclarecimento ao Contribuinte"
; Change HKCU to HKLM to affect all users on this system.
RegWrite REG_DWORD, HKLM, Software\Microsoft\Terminal Server Client , RemoteDesktop_SuppressWhenMinimized, 2
run, C:\\Program Files (x86)\\Programas RFB\\Sicalc Auto Atendimento\\SicalcAA.exe
sleep, 1000
ControlClick, ThunderRT6CommandButton1, Esclarecimento ao Contribuinte,,,, NA
Sleep, 1000
WinMenuSelectItem, Sicalc Auto Atendimento, , Funções, Preenchimento de DARF
Sleep, 1500
ControlFocus, ThunderRT6TextBox5, Sicalc Auto Atendimento
Sleep, 500
ControlSend, ThunderRT6TextBox5, %6%, Sicalc Auto Atendimento
Sleep, 500
ControlClick, ThunderRT6TextBox12, Sicalc Auto Atendimento,,,, NA
Sleep, 500
ControlClick, ThunderRT6TextBox9, Sicalc Auto Atendimento - [Auto Atendimento],,,, NA
Send, %8%
Sleep, 500
send, {Tab}
Sleep, 500
ControlClick, ThunderRT6TextBox7, Sicalc Auto Atendimento - [Auto Atendimento],,,, NA
send, {Tab}
Sleep, 500
ControlGet, aVariableEnabled, Enabled ,, ThunderRT6ComboBox4, Sicalc Auto Atendimento
if(aVariableEnabled = 1)
{
varTipo = %6%
if(varTipo = 2089 or varTipo = 2372)
{
myString := "Trimestral"
ControlSend, ThunderRT6ComboBox4, %myString%, Sicalc Auto Atendimento
}
;else if(varTipo = 1708)
;{
; myString := "Decendial"
;}
else
{
myString := "Mensal"
ControlSend, ThunderRT6ComboBox4, %myString%, Sicalc Auto Atendimento
}
}
ControlClick, ThunderRT6TextBox5, Sicalc Auto Atendimento - [Auto Atendimento],,,, NA
send, %1%
Sleep, 500
send, {Tab}
Sleep, 500
ControlClick, ThunderRT6TextBox6, Sicalc Auto Atendimento - [Auto Atendimento],,,, NA
Sleep, 1000
send, %2%
Sleep, 500
send, {Tab}
Sleep, 500
Sleep, 500
ControlClick, ThunderRT6CommandButton11, Sicalc Auto Atendimento - [Auto Atendimento],,,, NA
Sleep, 1000
Sleep, 500
ControlClick, ThunderRT6CommandButton5, Sicalc Auto Atendimento - [Auto Atendimento],,,, NA
Sleep, 500
Sleep, 500
ControlFocus, ThunderRT6TextBox6, Preenchimento DARF Auto Atendimento
ControlSend, ThunderRT6TextBox6, %3%, Preenchimento DARF Auto Atendimento
Sleep, 500
send, {Tab}
send, %4%
Sleep, 500
Send, {Tab}
Sleep, 500
send, %5%
Sleep, 500
send, {Tab}
if WinExist("Sicalc Auto Atendimento"){
ControlFocus, Button1, Sicalc Auto Atendimento
Sleep, 500
ControlClick, Button1, Sicalc Auto Atendimento,,,, NA
Sleep, 1000
}
temcod := %10%
if (temcod == "0")
{
ControlFocus, ThunderRT6OptionButton1, Preenchimento DARF Auto Atendimento,,,, NA
ControlClick, ThunderRT6OptionButton1, Preenchimento DARF Auto Atendimento,,,, NA
}
else
{
ControlFocus, ThunderRT6OptionButton2, Preenchimento DARF Auto Atendimento,,,, NA
ControlClick, ThunderRT6OptionButton2, Preenchimento DARF Auto Atendimento,,,, NA
}
ControlClick, ThunderRT6CommandButton4, Preenchimento DARF Auto Atendimento
Sleep, 3000
;Microsoft Print to PDF em pt
if WinExist("Salvar Saída de Impressão como")
{
ControlSend, Edit1, %7%, Salvar Saída de Impressão como
Sleep, 3000
ControlClick, Button2, Salvar Saída de Impressão como,,,, NA
Sleep, 2000
}
;Microsoft Print to PDF in english
if WinExist("Save Print Output As")
{
ControlSend, Edit1, %7%, Save Print Output As
Sleep, 3000
ControlClick, Button2, Save Print Output As,,,, NA
Sleep, 2000
}
;Microsoft XPS Document Writer
if WinExist("Salvar arquivo como")
{
WinActivate, Confirmar Salvar como
ControlFocus, Edit1, Salvar arquivo como,,,, NA
ControlSend, Edit1, %7%, Salvar arquivo como
Sleep, 3000
ControlClick, Button2, Salvar Saída de Impressão como,,,, NA
Sleep, 2000
}
;Foxit Reader PDF Printer in english
if WinExist("Print to PDF Document - Foxit Reader PDF Printer")
{
WinActivate, Confirmar Salvar como
ControlFocus, Edit1, Print to PDF Document - Foxit Reader PDF Printer,,,, NA
ControlSend, Edit1, %7%, Print to PDF Document - Foxit Reader PDF Printer
Sleep, 1500
ControlClick, Button2, Print to PDF Document - Foxit Reader PDF Printer,,,, NA
Sleep, 6000
Process, Close, FoxitReader.exe
Sleep, 2000
}
;Foxit Reader PDF Printer em pt
if WinExist("Imprimir em Documento PDF - Foxit Reader PDF Printer")
{
WinActivate, Confirmar Salvar como
ControlFocus, Edit1, Imprimir em Documento PDF - Foxit Reader PDF Printer,,,, NA
ControlSend, Edit1, %7%, Imprimir em Documento PDF - Foxit Reader PDF Printer
Sleep, 1500
ControlClick, Button2, Imprimir em Documento PDF - Foxit Reader PDF Printer,,,, NA
Sleep, 6000
Process, Close, FoxitReader.exe
Sleep, 2000
}
;CutePDF
if WinExist("CutePDF Writer")
{
ControlFocus, Edit1, CutePDF Writer,,,, NA
ControlSend, Edit1, %7%, CutePDF Writer
Sleep, 1500
ControlClick, Button11, CutePDF Writer,,,, NA
Sleep, 6000
sleep, 2000 ;pra servidores um pouco mais lentos
Process, Close, FoxitReader.exe
Sleep, 2000
}
;-----------------------------------------------------------------------------------
WinKill , Preenchimento DARF Auto Atendimento
WinKill , Sicalc Auto Atendimento - [Auto Atendimento]
WinKill , Preenchimento de DARF
WinKill , Sicalc Auto Atendimento
ExitApp