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

Add a window-changing shortcut to iTunes2 Apps
I just downloaded iTunes, and the new version reminded of an annoyance that has been with iTunes since the beginning--namely, that there's no keyboard shortcut to switch between normal and compact window modes. So I took it upon myself to figure out how to make one for it. The result can be found at:

http://reverie.rem.cmu.edu/~reverie/Localized.rsrc.sit

which you should unstuff and then use the Finder to copy the file into iTunes.app/Contents/Resources/English.lproj/ (control-click on the iTunes application and select "Show package contents" to find this folder). Make sure iTunes isn't running before you start.

If you want a more detailed explanation of how this hack was created, read the rest of the article.

[Editor's note: I have installed this modified file, and it works just as described. A couple of cautions -- make a copy of your iTunes app in the Finder before you start, and do not use the Terminal's 'cp' command. These files are resource-fork-only files, and you will kill their contents if you use the 'cp' command! If you must use the Terminal, use "CpMac" instead! Don't ask me how I know this...]

The difficulty with this edit lies in the fact that iTunes doesn't use standard menu resources, forcing me to reverse-engineer the resources using ResEdit's hex editor. I eventually tracked it down to being in the çMNU (that's cedille-M-N-U) resource. If you look at the ascii output of each menu item, you'll see that, for example, Copy looks like:

copyC ^Copy

Where copy is the 4-character internal name of the menu item, C is the keyboard shortcut, ^ is upside-down from what's actually displayed, and Copy is the displayed name. A menu item that doesn't have any shortcut, like Clear in iTunes, will look like:

clr ^ ^Clear

The upside-down ^ characters can actually represent any number of ascii codes--I think they're all control sequences (if you know your unix, you'll know what these are). In this case, the blank control code is 00 hex.

I still can't figure out how to create something like the Command-Shift-A that represents Select None in iTunes, and since I wasn't feeling particularly creative, I decided to use Command-Z for Zoom and just remove the shortcut for Undo. (Who ever uses Undo in iTunes, anyway?) To do this, I first made a backup of iTunes (note: ALWAYS do this). Then I opened resource 130 with the Hex Editor, selected the Z for Undo, then selected the hex code that got a rectangle around it as a result. I typed a 0, and it changed the Z to an upside-down ^. Then I went to resource 135, found the upside-down ^ for Zoom, selected it, and changed it to a Z. Save the file, launch iTunes, and voila, Command-Z now switches between the two window modes!

Note that changing Cocoa apps is completely different, since they use .nib files (editable by the Interface Builder) instead of .rsrc files. In fact, editing many Carbon or Classic apps is different than this, because they often have a differently named set of resources that can be edited with a much nicer interface.

If anyone has more information on more complicated keyboard shortcuts (Command-Shift-A, Command-Option-Down, etc.), I would be very interested in hearing it.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[3,411 views]  

Add a window-changing shortcut to iTunes2 | 6 comments | Create New Account
Click here to return to the 'Add a window-changing shortcut to iTunes2' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
ditto
Authored by: rgoer on Nov 04, '01 10:26:21PM
a
sudo ditto -rsrcFork
would also work

[ Reply to This | # ]
Resorcerer works
Authored by: sabi on Nov 05, '01 08:06:11PM

If you have Resorcerer, there's a çMNU template included in the iTunes resource file, you don't need to decode the format yourself.

I wish command-/ could be used, it's a pretty standard shortcut for zoom - unfortunately it's assigned to Help and I can't figure out how to get rid of it.



[ Reply to This | # ]
Amended instructions
Authored by: reverie on Jan 19, '02 01:44:27PM

Unfortunately, as the versions of itunes get updated, simply replacing the Localized.rsrc won't work without introducing various glitches--e.g., when you get info on a track, the genre field won't work. The slightly more complicated way to do it is as follows: after you've downloaded my Localized.rsrc, open it up in ResEdit and copy the çMNU resource. Then open the Localized.rsrc in your copy of iTunes (you ARE working with a copy, right?) and paste. It will ask you if you want to replace resources with the same ID--tell it to make it so. Save, Quit.



[ Reply to This | # ]
Amended instructions
Authored by: hombre on Oct 02, '02 12:39:46PM

Every time iTunes gets updated, I have to figure this out again, so this time I jotted down some notes on how I do it. The relevant resource number has changed. It is very simple with the tools used, but other tools can be used. I use Cmd-0 for the keyboard shortcut and map that to the same function key I use in other apps for 'zoom' using Keyboard Maestro.

Recipe:

The relevant file is /iTunes.app/Contents/Resources/English.lproj/Localized.rsrc.

Swap the resource and data forks (in Path Finder Get Info).

ResEdit won't do. Use Resorcerer (in Classic).

Select xMNU type

Open Resource 138 "Window"

Scroll to Internal command 'zoom'

Set Key to '0' (zero)

Set Modifiers to $00 (cmd) (it's the default).

Save.

Swap forks.

Done.

Of course, this is all done on a backup copy.



[ Reply to This | # ]
editing contents of iTunes.app
Authored by: osxpounder on Oct 02, '02 01:23:58PM

I ALT-dragged to make a copy of the iTunes app, and chose "Show Contents" from the contextual menu [CM]. The Contents folder, alone, appears, and it looks ghosted, semi-transparent. Double-clicking on it or choosing "Open" from its CM does nothing.

Does anyone know why my OSX 10.1.5 won't let me copy iTunes, then open and view the package contents?

I also tried using CMD C and CMD V to paste a copy of iTunes to my desktop, with the same result....

osxpounder



[ Reply to This | # ]
editing contents of iTunes.app
Authored by: osxpounder on Oct 02, '02 01:36:04PM

Never mind. I discovered CpMac for the first time while reading this discussion, and I figured out how to copy iTunes.app using that command. Sorry!

If I knew of a way to withdraw or edit a comment after I'd posted it, I could have simply withdrawn my question. If there is a way, let me know.

osxpounder



[ Reply to This | # ]