Created
November 14, 2012 15:47
-
-
Save hovsater/4072890 to your computer and use it in GitHub Desktop.
Populate/Repopulate Alfreds text field
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
# I have seen several requests from developers trying to populate/repopulate | |
# Alfreds text field with another value. While this is not a native solution, | |
# it's still suffice quite well. | |
# | |
# Explaination | |
# | |
# In order to get access to Alfreds windows, it must be toggled. We can achieve | |
# that by triggering the hotkey specified for Alfred. When toggled, it's as easy | |
# as just setting a new value for the first text field of window 1. | |
# | |
# | |
# This snippet will populate Alfred with a IMDB search for the movie | |
# The Green Mile. It assumes the hotkey is COMMAND + SPACE. | |
tell application "System Events" | |
keystroke " " using command down | |
tell process "Alfred" to set value of text field 1 of window 1 to "imdb The Green Mile" | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment