Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui.active_window().doc returns URL-encoded spaces #473

Closed
phillco opened this issue Jan 23, 2022 · 3 comments
Closed

ui.active_window().doc returns URL-encoded spaces #473

phillco opened this issue Jan 23, 2022 · 3 comments

Comments

@phillco
Copy link

phillco commented Jan 23, 2022

When viewing a file that has spaces in it, ui.active_window().doc returns a path with URL-encoded spaces even though it's not a file:// URL:

>>> ui.active_window().doc
'/Users/pcohen/Desktop/Test%20File.txt'
>>> ui.active_window().element.AXDocument
'file:///Users/pcohen/Desktop/Test%20File.txt'

Screen Shot 2022-01-23 at 3 35 04 PM

@nriley suggested this may be a bug.

@lunixbochs
Copy link

should be fixed in next beta

@phillco
Copy link
Author

phillco commented Sep 28, 2024

I noticed that window.doc decodes but the accessibility property doesn't. Is that intentional?

>>> ui.apps(bundle='com.apple.ScreenSharing')[0].windows()[0].doc
'/Users/phillco/Library/Containers/com.apple.ScreenSharing/Data/Library/Application Support/Screen Sharing/Mac Studio (phillco).vncloc'
>>> ui.apps(bundle='com.apple.ScreenSharing')[0].active_window.element.AXDocument
'file:///Users/phillco/Library/Containers/com.apple.ScreenSharing/Data/Library/Application%20Support/Screen%20Sharing/Mac%20Studio%20(phillco).vncloc'

@lunixbochs
Copy link

it's a CFURL/NSURL behind the scenes, this seems like correct handling of the raw attribute to me

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

No branches or pull requests

2 participants