Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Toggle iTunes' window state with a keystroke Apps
The hint http://www.macosxhints.com/article.php?story=20040208143120318&query=itunes got me thinking about how I might Zoom the iTunes window with only a keystroke. The following AppleScript will toggle the window between the big main window and the smaller control-only (or control-and-text) window.

Read the rest of the hint for the script.

Enter in the following in the Script Editor:

property BROWSER_WINDOW_LEFT : 2
property BROWSER_WINDOW_TOP : 22
property BROWSER_WINDOW_BOTTOM : 704

---------------------------------------

property okflag : false

-- check if iTunes is running
tell application "Finder"
  if (get name of every process) contains "iTunes" then 
    set okflag to true
end tell
if okflag then
  
  tell application "iTunes"
    
    if get minimized of browser window 1 is true then
      set minimized of browser window 1 to false
      set position of browser window 1 to 
        {BROWSER_WINDOW_LEFT, BROWSER_WINDOW_TOP}
          else if get minimized of browser window 1 is false then
      set minimized of browser window 1 to true
      set position of browser window 1 to 
        {BROWSER_WINDOW_LEFT, BROWSER_WINDOW_BOTTOM}
          end if
    
  end tell
  
end if
I make it executable from anywhere in the system by assigning it a keystoke in Youpi Key.

[robg adds: Youpi Key is now iKey, a $20.00 shareware package.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[7,913 views]  

Toggle iTunes' window state with a keystroke | 10 comments | Create New Account
Click here to return to the 'Toggle iTunes' window state with a keystroke' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Toggle iTunes' window state with a keystroke
Authored by: earthsaver on Mar 01, '04 11:16:11AM
Why bother using a complex AppleScript or expensive shareware app when the functionality is built into Panther. Just add a keyboard shortcut via the Keyboard & Mouse Preference Pane. I use Command+Option+Z in the Finder for Create Archive, but (as I just discovered) the Panther Finder has no Zoom Window menu selection, so I selected Command+Option+Z for Zoom in All Applications. Anyway, just restart the application (such as iTunes) and you'll find the chosen shortcut next to Zoom in the Window menu, if the app has such a selection available.

---
- Ben Rosenthal
Q16 1.25 - Panther

[ Reply to This | # ]

Toggle iTunes' window state with a keystroke
Authored by: gilburns on Mar 01, '04 11:59:12AM
Actually, Command+Control+Z would be a better choice for iTunes. The behavoir of the zoom for iTunes is different depending on the state of the option key.

When the option key is not used, clicking the zoom button changes the window state between the full window and the small control window. When the option key is held down, the window zooms like the finder windows, changing the window size to fit the screen.

By using Command+Option+Z iTunes sees the option key as down, and the window just changes size, it does not toggle between full and controls.



[ Reply to This | # ]
Toggle iTunes' window state with a keystroke
Authored by: ppp on Mar 01, '04 12:12:10PM

Thanks!



[ Reply to This | # ]
Toggle iTunes' window state with a keystroke
Authored by: GlowingApple on Mar 01, '04 04:32:42PM

Do you know if Command+Shift+Z has any conventional assignments? I've been using that key shortcut for Zoom for some time now and the only conflict I've had is with the Redo command in Mail. Since I rarely have to use Redo, and since for some reason Zoom takes precedence over Redo I have no problem. Are there any other conflicts anyone can foresee?

Thanks

---
Jayson

When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]
Toggle iTunes' window state with a keystroke
Authored by: Han Solo on Mar 01, '04 08:56:04PM
I tried using Control-Shift-Z for "Zoom" and Control-Shift-A for "Bring All to Front" for All Applications in the 10.3.2 Keyboard Shortcuts tab of the Keyboard & Mouse System Preference Pane. Neither seems to have any effect. Must short-cuts set there contain the Command key as well to function?

Hmm... That doesn't seem to have any effect either. Does one have to log out or quit apps first for these new shortcuts to work?

Argh! The newly-defined shortcuts have no effect in a subsequently-launched Cocoa app. What gives?? I can't afford to mess around with logging out & back in right now....

[ Reply to This | # ]

Toggle iTunes' window state with a keystroke
Authored by: ppp on Mar 01, '04 12:10:13PM

For me the Keyboard Shortcut for the Zoom menu just adjusts the window size and position, it doesn't reduce the window to the controller/display only size. Selecting the menu command Zoom with the mouse does do this. Since that's what is supposed to be activated by the shortcut, it seems that this should work correctly. Anyone else have success?



[ Reply to This | # ]
Toggle iTunes' window state with a keystroke
Authored by: jakacmar on Mar 01, '04 04:35:30PM

As mentioned by others, this is most likely due to using the option key in your shortcut for "Zoom" in iTunes. Clicking "Zoom" in the "window" menu of iTunes while holding down the option key will zoom the window to a size necessary to view the whole screen (e.g., all columns), clicking zoom without the option key held will toggle normal/mini modes. Change the keyboard shortcut so it doesn't use Option (e.g., Command-Control-z as others have suggested and which I've been using for a little over a month now) and it should behave correctly.



[ Reply to This | # ]
Toggle iTunes' window state with a keystroke
Authored by: jakacmar on Mar 01, '04 04:37:48PM

I wouldn't recommend setting a system-wide (e.g., "All Applications") shortcut for Zoom. Some apps actually have a "Zoom" submenu (the first to come to mind is Windows Media Player but I know there are others) and the keyboard shortcut seems to interfere with these submenus, making them unselectable. Just thought people might want to know.



[ Reply to This | # ]
Toggle iTunes' window state [iKeys easier method]
Authored by: MtnBiker on Mar 01, '04 01:36:40PM

In iKeys, I have a menu shortcut that

1. Selects "Name" "Window" "By full name"
2. and selects "Zoom" "by full name"

and in a set for iTunes, I have this set to the same key I use to bring up iTunes.

So in practice I click F13 to bring up itunes, then F13 again to Zoom to full size.

Maybe I missed something that the AS does.

---
Hermosa Beach, CA USA



[ Reply to This | # ]
I can't get it to work in ALL apps
Authored by: TvE on Mar 01, '04 02:45:08PM

In OS 9 I was using QuicKeys to set CTRL-Z to "Zoom window" so I was very happy to see that 7B85 :) could do the same in general in the OS.

BUT I am unable to get it to work in all applications, M$ Office - but they're known to behave differently - but EG Preview will not work for me anymore (it worked in the old seeds I was then using).

Am I the only one observing that problem?



[ Reply to This | # ]