Skip to content

Instantly share code, notes, and snippets.

@SKaplanOfficial
Last active November 15, 2022 01:33
Show Gist options
  • Save SKaplanOfficial/4fc46576a4ef0f3a1fea9dd093ae2db5 to your computer and use it in GitHub Desktop.
Save SKaplanOfficial/4fc46576a4ef0f3a1fea9dd093ae2db5 to your computer and use it in GitHub Desktop.
Using PyXA to open a new tab or window of Safari
# Tested with PyXA 0.1.0
import PyXA
app = PyXA.Application("Safari")
new_tab = app.make("tab", {"URL": "http://google.com"})
app.front_window().tabs().push(new_tab)
# Tested with PyXA 0.1.0
import PyXA
app = PyXA.Application("Safari")
new_doc = app.make("document", {"URL": "http://google.com"})
app.documents().push(new_doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment