Trigger/press app buttons which does not have shortcut for them

I like the "iScreen Shoter" app, however I really miss the shortcut functionally from Shottr for example, where I can press R which will trigger rectangular selection, C will trigger "Counter" etc.

Inspired by this topic, I'm also seeking for your ideas, thoughts etc. how this can be achieved. The only way I can think of is to do "Find/Search Image on Screen & Move Mouse", but just wanted to check with you guys if you have any other ideas.

Thank you in advance.

Unfortunately, I don't know these apps. The alternative I can think of to “Find/Search Image on Screen & Move Mouse” is the “absolute” position. If you can manage to ensure that something always has the same position relative to something else, then you don't need image recognition.

But that probably doesn't work in your case?

@Frank1, thanks for this, but the the bar with the buttons is placed depending on the screenshot so the "absolute" position won't work. I've now also saw that for some reason the screenshot of "iScreen Shoter" is not in my first post, so here it is:

Mm, will the screenshot create a floating window that BTT could move to a specific location? For example, to the top left corner of the screen, then you would have an anchor point.

Ah, wait, is the screeshot recognized as a front window?

Well the focused_window_title, focused_window_app_name, active_app_name, active_app_executable_path and active_app_bundle_identifier are related to this app.

Also the Focused UI Element Inspector is showing this when app is active/I've triggered screenshot action:

<AXApplication: "iScreen Shoter">
 <AXWindow: "Window">

Attributes:
   AXFocused:  "1"
   AXFullScreen:  "0"
   AXTitle:  "Window"
   AXChildrenInNavigationOrder:  "<array of size 3>"
   AXFrame:  "x=2048 y=0 w=2048 h=1152"
   AXPosition (W):  "x=2048 y=0"
   AXGrowArea:  "(null)"
   AXMinimizeButton:  "(null)"
   AXDocument:  "(null)"
   AXSections (W):  "<array of size 20>"
   AXCloseButton:  "(null)"
   AXMain:  "0"
   AXActivationPoint:  "x=-1 y=1153"
   AXFullScreenButton:  "(null)"
   AXProxy:  "(null)"
   AXDefaultButton:  "(null)"
   AXMinimized:  "0"
   AXChildren:  "<array of size 3>"
   AXRole:  "AXWindow"
   AXParent:  "<AXApplication: "iScreen Shoter">"
   AXTitleUIElement:  "(null)"
   AXCancelButton:  "(null)"
   AXModal:  "0"
   AXSubrole:  "AXUnknown"
   AXZoomButton:  "(null)"
   AXRoleDescription:  "window"
   AXSize:  "w=2048 h=1152"
   AXToolbarButton:  "(null)"
   AXIdentifier:  "_NS:10"

Actions:
   AXRaise - raise

Is it then not possible to click a button on the basis of this window, relatively to the top left corner?

Or, does the x stand for “cancel”? Maybe this would help?

image

Sorry, I don't know, I'm just guessing.

Can you post a screenshot or video about which function you want to trigger in that app? I think it can be scripted with Apple Script.

The screenshot is in my 2nd post and the functions are marked in red. Each of the buttons have a tooltip like rectangular, line, arrow, oval etc.

So for example this script would press the rectangle button:

tell application "System Events" to click UI element 1 of group 2 of group 1 of window "Window" of application process "iScreen Shoter"

I'm sure there are better ways to figure these out, but I often use Automator and use the "Record" function which gives you something like this:

You can then select these and copy them to your clipboard - it will copy the apple script source (which however usually needs to be simplified a bit because Autmator includes all sorts of delays etc.)

This is great. Thank you Andreas! I had no idea about Automator. @Frank1 , thank you as well!

1 Like