Plugin Window Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Plugin Window

Post by Philharmonic » 28 Jun 2017, 11:27

Morning everyone!

So far, the help on this forum has been tremendous. I was able to script basic hotkeys for a program I use regularly at work and at home :D

There is one particular task I cannot seem to tackle though. Below is the following script:

Code: Select all

PgUp::
WinMenuSelectItem, Pro Tools, , AudioSuite, Noise Reduction, iZotope RX 5 De-click
#IfWinActive run, process
return

I've attached a image for you guys to see. I believe the visual will help. The great news is that from the script above, I'm able to bring up the audiosuite plugin :bravo: The bad news, is that I'm unable to figure out how to click/hit the render button on the bottom right corner. I know that I can use mouse base location, but that would not be ideal for me because the plugin window will not always be in the same location. I'd much rather figure out a script (from your help hopefully) and be able to render a file with a hotkey.

Additionally, just for the sake of it, I was hoping if there is a way to close the plugin window after it has process a file. I'm assuming I would have to input some sort of delay due to the fact that it takes a certain amount of time to render a file before closing.

Again, thanks in advance everyone for your help! :dance:
Attachments
Pro Tools_Screenshot.png
Pro Tools_Screenshot.png (125.69 KiB) Viewed 4335 times

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Plugin Window

Post by BoBo » 28 Jun 2017, 12:06

I'm assuming I would have to input some sort of delay due to the fact that it takes a certain amount of time to render a file before closing
I'd use a SetTimer-routine to check the size of the rendered output/file (if you can't trigger a Statusbar-control that provides a specific "done" statement). Once its size won't change you should be fine to kill that window.

To identify (how to trigger) the correct control check :arrow: this out.
Good luck. :)

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 28 Jun 2017, 12:13

Thanks for the input Bobo. Do you know of a way to activate the render button on the plugin window? The script I listed above enables me to bring up that window, but I want to be able to hit that render button on the bottom right corner, without using mouse base location.

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 28 Jun 2017, 16:25

Philharmonic wrote: :?: :?


Morning everyone!

So far, the help on this forum has been tremendous. I was able to script basic hotkeys for a program I use regularly at work and at home :D

There is one particular task I cannot seem to tackle though. Below is the following script:

PgUp::
WinMenuSelectItem, Pro Tools, , AudioSuite, Noise Reduction, iZotope RX 5 De-click
#IfWinActive run, process
return



I've attached a image for you guys to see. I believe the visual will help. The great news is that from the script above, I'm able to bring up the audiosuite plugin :bravo: The bad news, is that I'm unable to figure out how to click/hit the render button on the bottom right corner. I know that I can use mouse base location, but that would not be ideal for me because the plugin window will not always be in the same location. I'd much rather figure out a script (from your help hopefully) and be able to render a file with a hotkey.

Additionally, just for the sake of it, I was hoping if there is a way to close the plugin window after it has process a file. I'm assuming I would have to input some sort of delay due to the fact that it takes a certain amount of time to render a file before closing.

Again, thanks in advance everyone for your help! :dance:

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 28 Jun 2017, 23:02

Could someone please help? This is one of the last missing piece of puzzle for my script. Any insight would be super grateful!

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 29 Jun 2017, 16:42

:cry:

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Plugin Window

Post by BoBo » 29 Jun 2017, 17:03

Have you checked out the linked WinSpy tool already? That way you should be able to identfy the (render)-button control ID/details.
Afterwards you can use ControlClick/Send-/PostMessage/... commands. Good luck :)

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 30 Jun 2017, 16:53

BoBo wrote:Have you checked out the linked WinSpy tool already? That way you should be able to identfy the (render)-button control ID/details.
Afterwards you can use ControlClick/Send-/PostMessage/... commands. Good luck :)

Thanks Bobo,

Code: Select all

#IfWinActive ahk_class DigiFloaterClass
PgUp::
SetControlDelay -1
ControlClick, RX5Declicker HostWindow,,,, NA x935 y814
return
Unfortunately the script above did not work for me. Not sure what I'm doing wrong :oops: Anyways, I'll have to play with it some more and I'll give you guys an update. Thanks!

ConraLaje
Posts: 1
Joined: 14 Apr 2020, 19:04

Re: Plugin Window

Post by ConraLaje » 14 Apr 2020, 19:07

Hey! I'm looking for the same action! Have you figured it out?

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 17 Apr 2020, 13:57

Unfortunately not. I've kinda gave up on this specific task. I guess I'll just be contempt to bring up the plugin window now. Hopefully you'll have better luck than me. Let me know if you do figure it out.

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Plugin Window

Post by boiler » 17 Apr 2020, 16:08

It should be easy to do using ImageSearch and Click. Something like this:

Code: Select all

CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
loop, 50 ; wait a maximum of 5 seconds (50 * 100ms) for render button to appear
{
	ImageSearch, ImX, ImY, 0, 0, A_ScreenWidth, A_ScreenHeight, render.png
	Sleep, 100
} until !ErrorLevel
if ErrorLevel
	MsgBox, Could not find 'Render' button
else
	Click, %ImX%, %ImY%
You need to create an image of the Render button named render.png and place it in the same directory as the script. Make sure you do the screen capture in a lossless format so the png ends up without any compression artifacts (i.e., the image looks pixel-for-pixel exactly like the it does in the app).

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 17 Apr 2020, 17:24

boiler wrote:
17 Apr 2020, 16:08
It should be easy to do using ImageSearch and Click. Something like this:

Code: Select all

CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
loop, 50 ; wait a maximum of 5 seconds (50 * 100ms) for render button to appear
{
	ImageSearch, ImX, ImY, 0, 0, A_ScreenWidth, A_ScreenHeight, render.png
	Sleep, 100
} until !ErrorLevel
if ErrorLevel
	MsgBox, Could not find 'Render' button
else
	Click, %ImX%, %ImY%
You need to create an image of the Render button named render.png and place it in the same directory as the script. Make sure you do the screen capture in a lossless format so the png ends up without any compression artifacts (i.e., the image looks pixel-for-pixel exactly like the it does in the app).


Super appreciate getting back to me. That's really nice of you. I have copied the code you wrote, but now there is a message box that prompts up saying "Could not find 'Render' button," which I notice is written in the code. Could I be missing a step?

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Plugin Window

Post by boiler » 17 Apr 2020, 17:31

Did you create the render.png image and place it in the script directory as I mentioned? Make sure that the image is a subset of the button itself so that when the script finds and clicks on it, it will be on the button itself instead of outside of it.

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 17 Apr 2020, 17:38

boiler wrote:
17 Apr 2020, 17:31
Did you create the render.png image and place it in the script directory as I mentioned? Make sure that the image is a subset of the button itself so that when the script finds and clicks on it, it will be on the button itself instead of outside of it.
I did create the render.png image using the snippet tool. I've attached the image for you to see. When you mention script directory, would that be located in "C:\Program Files\AutoHotkey"? That is where I placed the render.png image.
Attachments
Render.png
Render.png (1.31 KiB) Viewed 3480 times

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Plugin Window

Post by boiler » 17 Apr 2020, 17:45

You need to crop that image so it's within the bounds of the button itself for the reason described in my last post. Best to make the image just around the letters.

In what directory is the script file that you are running? That's where you put the image. Otherwise, you can specify the full path to the image by changing the ImageSearch to this:

Code: Select all

	ImageSearch, ImX, ImY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\Program Files\AutoHotkey\render.png


malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Plugin Window

Post by malcev » 17 Apr 2020, 18:05

I do not have ProTools, but in izotope rx7 audio editor You can automate elements with iaccessible interface.
I suggest You download this utility
https://github.com/serzh82saratov/AhkSpy/blob/master/AhkSpy.ahk
Click with right button on its title, check view settings -> dynamic accessible path.
Then put mouse in front of Your button and see does it have Accessible path in Control menu of AhkSpy.
PS Do not use accviewer from our forum, because it is buggy.
If You want to see tree of elements then use accexplorer32
https://github.com/blackrosezy/gui-inspect-tool/blob/master/AccExplorer32.exe
or inspect
https://github.com/guolaok/Python-UIAutomation-for-Windows/tree/master/inspect

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 17 Apr 2020, 18:57

boiler wrote:
17 Apr 2020, 17:45
You need to crop that image so it's within the bounds of the button itself for the reason described in my last post. Best to make the image just around the letters.

In what directory is the script file that you are running? That's where you put the image. Otherwise, you can specify the full path to the image by changing the ImageSearch to this:

Code: Select all

	ImageSearch, ImX, ImY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\Program Files\AutoHotkey\render.png
I'm sorry to keep wasting your time on this, but I just can't figure it out. I re-cropped the image so that it'll just show the letters. I copied the new directory you added and I still get the message box that says "could not finder 'Render' button." Are the words in the script case sensitive? Meaning the word "Render." There's a uppercase "R" and a lower case "r" for "render" in the script. Are the .png file case sensitive too? I've tried multiple ways with no luck.

I've looked at the tutorial and initially tried using " Gui or Menu" in the script to see if it could work, but of course nothing productive came out of that. I'm sure I'm doing something wrong.
Attachments
render.png
render.png (781 Bytes) Viewed 3399 times

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 17 Apr 2020, 19:19

malcev wrote:
17 Apr 2020, 18:05
I do not have ProTools, but in izotope rx7 audio editor You can automate elements with iaccessible interface.
I suggest You download this utility
https://github.com/serzh82saratov/AhkSpy/blob/master/AhkSpy.ahk
Click with right button on its title, check view settings -> dynamic accessible path.
Then put mouse in front of Your button and see does it have Accessible path in Control menu of AhkSpy.
PS Do not use accviewer from our forum, because it is buggy.
If You want to see tree of elements then use accexplorer32
https://github.com/blackrosezy/gui-inspect-tool/blob/master/AccExplorer32.exe
or inspect
https://github.com/guolaok/Python-UIAutomation-for-Windows/tree/master/inspect

Thanks for the suggestion! izotope is one of many plugins I use in Pro Tools. All audio suite plugins has a "render" button in the bottom and I was just using izotope as an example. Truly appreciate the suggestion though and will take a look at the link you posted.

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Plugin Window

Post by Philharmonic » 17 Apr 2020, 19:51

w0z wrote:
17 Apr 2020, 18:00
you can use FindText function too.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=17834
you can watch some examples how is used:
https the-automator.com /use-findtext-autohotkey-to-skip-youtube-ads/ Broken Link for safety
https the-automator.com /speeding-up-the-findtext-image-function-to-get-quicker-results/ Broken Link for safety

Thanks for adding in your input. I'll definitely take a look at the link you posted. I'm a true novice to AHK and what I'm trying to apply should be simple in my own eyes, but hey, what do I know.

Post Reply

Return to “Ask for Help (v1)”