2

I use an Automator workflow to open iTunes at startup, etc.

I'd like it to open the MiniPlayer window. I don't see a function to do that in Automator.

How could I do this with an AppleScript script?

2 Answers 2

2

AFAIK you can only do this using UI scripting, here are some ways to switch to the miniplayer :

Simulating a click on the button in the interface :

tell application "System Events" to tell process "iTunes"
    click button 4 of window 1
end tell

Using the keyboard shortcut :

tell application "System Events"
    tell application "iTunes" to activate
    keystroke "m" using {option down, command down}
end tell

If you want to display the miniplay AND the fullsize player (your request isn't clear) use :

tell application "System Events"
    tell application "iTunes" to activate
    keystroke "3" using {option down, command down}
end tell
1

You can also do it by scripting the click of the menu item:

tell application "System Events"
    tell process "iTunes"
        tell menu bar 1
            tell menu bar item "Window"
                tell menu "Window"
                    click menu item "Switch to MiniPlayer"
                end tell
            end tell
        end tell
    end tell
end tell

…but it's still not a 'proper' method though :(

1
  • It also has the downside that I won't work on a non-english OSX. That's why I didn't suggest it. Commented Dec 15, 2013 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .