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?
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
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 :(