So assuming that I'm in a playlist I'd like to be able to type a keyboard shortcut and then have my music library display on the main panel and then tab to the search bar and look for a song.
Just use Tab.
If you start with the focus on the playlist and hit Tab, the focus will go to the sidebar. You can start typing
Mus and the Music library will display in the main panel. Hit Tab again. The focus will jump to the search bar. Start typing the song you're looking for. Hit tab again and you're back in the main window where you started.
You can use OptionCommand + f to jump to the search box at any time regardless of where the focus is.
The script works perfectly when I run it from the AppleScript editor, but when I run it from the iTunes scripts menu it
- takes about 7 seconds to run
- changes my view to music, but doesn't leave the cursor in the search field
I ensured enable access for assistive devices is checked. It's frustrating as it does exactly what I want when running from the editor.
Any idea what could be wrong?
A little Applescript along these lines will work:
try tell application "iTunes" activate set winname to name of browser window 1 set view of window winname to playlist "Music" end tell tell application "System Events" tell application process "iTunes" set (value of text field 1 of window winname) to "" set focused of text field 1 of window winname to true end tell end tell on error
beep 1 end try
Put the script in /Users/.../Library/iTunes/Scripts to see it in your iTunes script Menu. You'll have to turn on "Enable Access for assistive devices" in the 'Universal Access' Preferences pane to let the script work. You can also add a keyboard shortcut to run the script when you're in iTunes thru the 'Keyboard Shortcuts' pane of the Keyboard preferences pane.