Last active
November 12, 2022 07:31
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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