Created
April 26, 2012 16:36
-
-
Save cspickert/2500847 to your computer and use it in GitHub Desktop.
Jump to the documentation search field in Xcode 4 using AppleScript.
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
#!/usr/bin/osascript | |
-- Jump to the documentation search field in Xcode 4's Organizer | |
-- To use, make sure "Enable access for assistive devices" is enabled in the Universal Access pref pane | |
tell application "System Events" | |
tell process "Xcode" | |
-- Activate Xcode if necessary | |
set frontmost to true | |
-- Open the Organizer | |
keystroke "2" using {shift down, command down} | |
set organizer to window 1 | |
-- Select the Documentation panel if it's not already selected | |
if the title of organizer is not "Organizer - Documentation" then | |
click button "Documentation" of tool bar 1 of organizer | |
delay 0.1 | |
set organizer to window 1 | |
end if | |
-- Move focus to the search field | |
set searchField to text field 1 of splitter group 1 of organizer | |
set searchField's focused to true | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To execute this script using a keyboard shortcut:
chmod +x "Search Xcode Documentation.applescript"