Last active
August 29, 2015 14:20
-
-
Save johan/753f0830a92c34d5042a to your computer and use it in GitHub Desktop.
Two osascript hacks to inventory osx application object models, for osascripting them from shell scripts
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
#! /bin/sh | |
# lists all widgets of the app named $1 to stdout | |
# You will probably need to first add Terminal.app here (osx Yosemite; 10.10.3): | |
# System Preferences -> Security & Privacy -> Privacy -> Accessibility | |
osascript \ | |
-e 'tell application "'$1'" to activate' \ | |
-e 'tell application "System Events" to tell process "'$1'" to set output to entire contents of front window' \ | |
| tr ',' '\n' \ | |
| sed 's/^ *//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment