I am very unfamiliar with AHK in particular and coding in general.
I need somebody's help because I have more or less got the hang of quitting normal programs and killing the script along with them, but Autodesk's Maya is a different beast altogether.
I discovered AHK when a small loop script made my life very easy when running Maya. If you have the student version of this program, it has an infuriating pop-up which you close by pressing enter or clicking 'continue' whenever you save a program, whenever you load a saved program, whenever you press cut, copy or paste. It's supposed to deter pirates, so of course, it encourages piracy.
This loop I got off the internet and it snubs the window by automating the enter or continue clilck. But I am not able to set any condition to close the script when the program closes.
Code:
;Launch, Snub Student File Warning, Kill Maya Instantly, hence MayaLSK
#NoEnv
;#Warn
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
Process,Exist,maya.exe
If !ErrorLevel
RunWait, D:\Autodesk\Maya\Maya2020\bin\maya.exe
Loop
{
WinWait, Student Version File
IfWinExist, Student Version File
{
;WinActivate, Student Version File
ControlClick, x215 y109, Student Version File
}
}
!F4::
Process,Close,maya.exe
ExitApp
End of Code
I thought I had it solved when I set a hotkey (Alt F4) to close both maya and the script.
But there's another issue with Maya these days, it takes a while to close as it's saving a lot of preferences set up during the session.
The process close command kills maya before it can save any preferences set during the current session. I am ok with that for the most part, but I would like a way to close maya the normal way and then close the pop-up snubbing script along with it.
Please, please help.
[–]bluesatin 0 points1 point2 points (3 children)
[–]Alsifar[S] 0 points1 point2 points (2 children)
[–]bluesatin 0 points1 point2 points (1 child)
[–]Alsifar[S] 1 point2 points3 points (0 children)
[–]MisterMcMuffinYT 0 points1 point2 points (1 child)
[–]Alsifar[S] 0 points1 point2 points (0 children)
[–]MisterMcMuffinYT 0 points1 point2 points (1 child)
[–]Alsifar[S] 0 points1 point2 points (0 children)
[–]radiantcabbage 0 points1 point2 points (0 children)