Is it possible to access the open tabs of Safari or Google Chrome? A URL would be good or the title of the tab or both?
The purpose of the app then the user could specify some websites and add labels to them and the app would measure how much is spent on those websites, the app would be allowed through accessibility.
Use an AppleScript to get the title and the URL of each tab.
You can use
NSAppleScript
in Swift to run an AppleScript.An example (Safari)
The AppleScript return a string, like this:
An example (Google Chrome)
Update:
Here's the AppleScript with the comments.
You can run it in the "Script Editor" application.