Skip to content

Conversation

martasumyk
Copy link

  • Extract multiple apps accessibility (of visible parts of them)
  • Extract accessibility of dock and upper menu bar

Example of screen with dock + upper menu accessibility:
Screenshot 2025-10-12 at 23 28 46

Copy link
Contributor

@mshamrai mshamrai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of redundancy. Fix and request review once more

for w in wins:
if int(w.get("kCGWindowLayer", 0)) != 0:
continue
owner = (w.get("kCGWindowOwnerName") or "").strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w.get("kCGWindowOwnerName") or "" -> w.get("kCGWindowOwnerName", "")

screenshot_tmp_file.close()


import macapptree.screenshot_app_window as screenshot_app_window
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be in the top

# "window_info": win,
# "tree": tree.to_dict()
# })
# return trees
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete redundant comments




if __name__ == "__main__":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it here?

except Exception:
pass

import subprocess, AppKit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To the top again

return pid_to_bundle, bundle_to_app


def get_visible_windows_for_bundles(bundle_ids: List[str]) -> List[Dict]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it in this module?

self.visible = False
if self.visible_bbox:
vx1, vy1, vx2, vy2 = self.visible_bbox
self.visible = (vx2 > vx1) and (vy2 > vy1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already checked in the _set_bboxes

if not vb:
return False
x1, y1, x2, y2 = vb
return (x2 > x1) and (y2 > y1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again?

return segment_image_path


def _is_visible(elem) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better make it a property of an object

# open the image and create a drawer
draw = image_drawer
image = image
img = image
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@mshamrai
Copy link
Contributor

Also, add in readme how to use your feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants