preset(item) { BlockInput, SendAndMouse BlockInput, On ;Send ^!+` ;Sleep 10 ;Send ^!+7 ;Sleep 10 SetKeyDelay, 0 MouseGetPos, xpos, ypos ;-----------------------stores the cursor's current coordinates at X%xpos% Y%ypos% ControlGetPos, X, Y, Width, Height, edit1, ahk_class Premiere Pro ;;;highlights Premier's effects panel search bar (info gotten from window spy) MouseMove, x+15, y+10 sleep 1 MouseClick, left, , , 1 ;----------------------clicks on Q icon to prepare for deletion sleep 1 Send +{backspace} ;----------------------------deletes sleep 1 MouseClick, left, , , 1 sleep 1 Send %item% sleep 1 MouseMove, x+18, y+167, ; ;msgbox, The cursor should be directly on top of the preset's icon. `n If not, the script needs modification. sleep 1 MouseGetPos, iconX, iconY, Window, classNN ;---now we have to figure out the ahk_class of the current panel we are on. It used to be DroverLord - Window Class14, but the number changes anytime you move panels around... so i must always obtain the information anew. sleep 1 WinGetClass, class, ahk_id %Window% ;----------"ahk_id %Window%" is important for SOME REASON. if you delete it, this doesn't work. tooltip, ahk_class = %class% `nClassNN = %classNN% `nTitle= %Window% sleep 50 ControlGetPos, xxx, yyy, www, hhh, %classNN%, ahk_class %class%, SubWindow, SubWindow ;-I tried to exclude subwindows but I don't think it works...? MouseMove, www/4, hhh/2, 0, R ;-----------------moves to roughly the CENTER of the Effects panel. This clears the displayed presets from any duplication errors. VERY important. without this, the script fails 20% of the time. This is also where the script can go wrong, by trying to do this on the timeline, meaning it didn't get the Effects panel window information as it should have... IDK how to fix yet. sleep 1 MouseClick, left, , , 1 ;-----------------------the actual click sleep 1 MouseMove, iconX, iconY, 0 MouseClickDrag, Left, , , %xpos%, %ypos%, ; BlockInput, off } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;That's the end of the function. ;All of these refer to presets I have already created and named in Premiere ;note that using ALT for these is kind of stupid... they can interfere with menus. ;ALT C, for example, will always open the CLIP menu. So I can't use that anywhere. ;Position Wifi Battle !u::preset("push") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #IfWinActive