Automatic clicking on java program buttons - autohotkey

So I need to automate some button clickings on a java program. I tried ahks/autoit's controlclick but it doesn't really work (normal clicks do work, but I require no mouse movement).
I tried to get some information from window detective / window spy, etc. but not much is displayed apart from the window name and ahk_class
Java Ferret shows quite a lot more information though: https://gyazo.com/3539415488ce3e03c90f3532327419f2
How can I trigger one of these "push button" actions? (say "Descendent 19 role")

If you can get the X and Y coordinates of the control along with the window name, you could use a mouse click event.
Other than that, you can try using an image search to find the control's X and Y and perform a mouse click.

Related

How to modify the button's behavior on mouse over event in Graphical Installer for NSIS?

I'm new to NSIS. When I truned into Graphical Installer, I found the button's reaction on mouse over event is a litter bit different from Win10's default, which supposed to turn on highlight when mouse moves in (otherwise, turn off). But buttons under Graphical Installer look dummy when mouse moves over, and highlight only when mouse clicks, just like older windows versions.
How can I modify the button's behavior to match the effect in Win10?
Buttons in Graphical Installer for NSIS are defined like this:
It is a bitmap (.bmp) file with 4 button states inside of it: normal, focused pressed and disabled.
Size (of each state) is 83 (width) x 26 (height) pixels, together 83 x 104 pixels.
I assume you are talking about Focused state - you need to make the picture for this state "highlighted" - e.g. in Gimp use a function to add brightness to this area of bitmap (see the provided buttons in examples folder).
Focused state is applied when button has focus (changed e.g. by pressing the Tab button) to signalize "active" button that can be triggered by pressing the Enter key.
So this works a little different, but we will consider this "highlight" feature.
See http://graphical-installer.com/files/manuals/nsis/source/html/intro%20-%20project-graphics.html for more info
P.S. I am developer of this tool, feel free to ask any question, also asking here on SO is fine.

Enable clicking on the Green circles in Eclipse to jump to code

How can I enable clicking on this bubble (or perhaps the name) to instantly jump to the underlined place in code? By pressing f2 and clicking on a small box, the same effect can be achieved, but I remember being able to work far faster doing this on one of my old projects.
Hold Ctrl and hover over the method name. You can then choose to jump to the declaration or super implementation.

AHK - mouseclick coordinates relative to app window

I was reading through AHK documentation but couldn't find one where it explains how to define the coordinates WITHIN a certain application window.
For example, I want to be able to minimize/maximize the ribbon in all microsoft office apps (top right corner). This should work reliably no matter whether the window is maximized or not, and the mouse cursor should not shift (or at least it should shift back) while doing so.
Any idea how i can achieve this?
If you want coordinates to be relative to the active window, you need to use the CoordMode command at the top of your script. The second parameter specifies the coordinate mode will be for mouse coordinates. The third parameter you can specify either Screen or Relative. Relative is what you are looking for.
CoordMode, Mouse, Relative

In notepad++ change tab size instantly

I'm using notepad++ (v6.5.3) and I constantly have to change the size of the tab for viewing some results. Not that it's taking me a lot of time to do it manually everytime, but it would be great if I could optimize that.
Is there a way to do so? Would a macro be the solution, or are they just for typing stuff?
Thanks a lot!
Ok, there's an easy way how you can achieve this - I have tested it right now:
Install AutoHotKey (or start portable version which runs without installation)
In Windows 7 and above, ensure you launched AutoHotKey as Administrator (otherwise you get inconsistencies in its behavior) - if not sure, exit it and restart it as administrator
Right click Autohotkey tray icon and select Edit This Script
Import the macro below this list at the end of the AutoHotKey script file and save the file
Right click Autohotkey tray icon and select Reload This Script.
–– This was end of general steps, now let's go with your macro: ––
In N++, display Preferences window and press its Close button1 at the bottom (NOT at the top-right corner)
Now you can use shortcuts Win+F2 and Win+F3 to switch different tab sizes instantly
SendMode Input
DetectHiddenWindows, On
SetTitleMatchMode, RegEx
;--------------------------------- Hotkeys for Notepad++ only
#IfWinActive ahk_class Notepad\+\+
#F2::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}16{Enter}{Tab 3}{Space}
#F3::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}4{Enter}{Tab 3}{Space}
#IfWinActive
1) Important: N++ user experience provided in dialog boxes is absolutely terrible. There are no anchors where you can fix focus when using keyboard. Thus you always need to perform step 4 manually when leaving Preferences dialog box otherwise the macros would send keys into incorect window page OR at correct page but incorrect control. Preferences dialog window remembers selected page and control. Macros I created for you therefore assume that correct page is already listed and button Close was recently focused.
Good news is Notepad++ windows with this weird behavior are rare exception from general user experience. In other places in N++ (or in other apps) where user interface components (menus, dialogs etc.) always start from the same point you do not need any special precautions like the one in step 4.
Adjust the macros as you like:
you can create more of them
you can adjust the numbers "16" and "4" typed into tab size input box
you can change shortcut keys to something else
you can replace sending keys with sending mouse clicks at desired screen/window positions
you can achieve many other useful shortcuts in N++ and in all other apps – check AHK deeper!

How can I go to the next Eclipse marker (e.g. build error) using the keyboard?

Suppose I make a method signature change that breaks several callers, and I want to review the call sites manually to update them.
Once I change the signature, my "Problems" view shows, say, a dozen errors.
What keys can I hit to navigate through them while leaving the keyboard focus in the editor for fast fixups?
(It's been a while, but I think the Visual Studio equivalent is F8.)
Note that this question does not duplicate Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)?, as that one seeks to navigate only between markers in the current file. In this case, I want to go to the next error regardless of which file it's in.
("Marker" is the general Eclipse term for errors, warnings, etc.)
The best I've come up with so far is Ctrl + F7 to flip to the Problems view, then ↓ to pick the topmost error, then Enter to go to it (which returns focus to the editor).
Here's a way to move to the next error, regardless of editor, in one keystroke. It's not perfect, but it works until it's fixed in Eclipse.
Open a "Markers" view. Click the down arrow at the top right, and choose "Configure Contents". Uncheck the show all box, and create the view to show only the problems you want to see. You'll probably want to deselect "warnings" and "errors" as well. Save it.
Click the same "Markers" down arrow, and choose "Group By". Select "None". This is important because you don't want the parent tree level nodes to show, otherwise some of your "next" actions will take you to those, which don't represent an error.
In Eclipse -> preferences -> keys, search for "Markers". If there is not a keystroke bound to the Markers view, create one. I use Ctrl + Shift + M
Get a keyboard hotkey tool like AutoHotKey (for PC's) or iKey for the Mac. I'm using iKey, but there are plenty of other Mac tools you can use. In your hotkey tool, define an action for the keystroke you want to use for "next error". I chose the standard CMD + .
For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:
Ctrl + Shift + M
Down arrow
Enter
Of course, you'll want to change the first one to whatever you picked for yours. You'll probably want to restrict that action to be executed only when Eclipse is the current application.
Save that, create some compile errors, and test it.
Try Ctrl + 3 for Quick access popup window.
If the "Markers view" is not already visible, then type in "markers", in the searchbox on the popup window. Once you have selected it, it should stay available, when you press Ctrl + 3 the next time around.
I just had the same problem, after refactoring some parts of code. I had a lot of errors in different files and i had to go through all of those.
I used the following solution:
Mark all (relevant) entries in the Problems view.
To do this switch to the Problems view using Ctrl+F7 and select the entries with Shift+↓/↑
You can also select all entries using Ctrl+A
Open the marked errors by pressing ↵.
Every file containing at least one marked error will be opened.
The cursor will automatically select one error/file, as if you open only this specific entry
Fix the errors in the opened file.
Here you can use Ctrl+. to navigate to next error inside this file
Close the file using Ctrl+W when your done.
Eclipse will automatically focus the next file and you can go back to step 3
In my case this solution was much faster then switching to the Problems view each time.
There's an Eclipse bug entered for this that has an attachment that looks like it does what you want.
You could use AutoHotkey:
save the mouse position, send a mouse event to click on the arrow in CDT console and then return the mouse back to it's original location. Record the mouse coords with window spy or use autohotkey's search by image function (first capture the images of two arrows with printscreen into bitmaps).