I would like to script my Mac to close a specific iCloud Tab of my choice that is open on my iPhone. This is for Accessibility reasons.
Ideally, I’d prefer to do this without using GUI scripting.
- AppleScript methods only seem to see tabs in Windows
- Extensions also do not seem to have visibility of the other types of tabs
I've tried many options so far, but all seem to not work and are also far too brittle even if they did.
I have a feeling I'm missing something!
1. Toolbar Dropdown
In Desktop Safari you can enable a toolbar button “iCloud Tabs” which when clicked shows a list of the tabs currently open on your other devices.
If you hover one, an X appears which can be clicked to close the tab. When you next use Safari on the remote device that tab will be closed. If it’s already open and awake then the removal happens around one second later. It’s quick.
(But I did try GUI scripting and I can get to the row in the outline in the popup, but I can’t get the cross to appear to click it)
2. Start Page
they’re also listed on favorites:// “start page” but there are issues viewing all and no way to search them. There used to be a search field until Safari ~15.
3. Omnibar
They’re also shown in omni/address bar, but getting the correct item to appear at all or in a predictable position is fragile.
4. Sidebar
Another alternative to the favorites/"start page" layout. Same issues.
5. Modifying Safari Database directly
Changes are not mirrored to the cloud. It seems Safari does a cloudd request that I can't do.