Skip to content

Instantly share code, notes, and snippets.

@SKaplanOfficial
Last active November 12, 2022 07:31
Show Gist options
  • Save SKaplanOfficial/e1d36b5d258203950786828654a912c2 to your computer and use it in GitHub Desktop.
Save SKaplanOfficial/e1d36b5d258203950786828654a912c2 to your computer and use it in GitHub Desktop.
Using PyXA to run a shortcut with the URL of a Safari tab as input
# Tested with PyXA 0.1.0
import PyXA
shortcuts = PyXA.Application("Shortcuts")
safari = PyXA.Application("Safari")
document = safari.current_document
shortcut = shortcuts.shortcuts().by_name("Save As PDF")
shortcut.run(document.url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment