Things MacOS could learn from Windows

Apple Matters has a story about what MacOS should ‘borrow’ from Windows. I’ll address them as I see the issue.

  1. Compatible control keys. These should be called Modifier Keys, and I think Apple does a better job. Control-C is used by every variety of Unix ever for sending a break: I'd like to see this remain. And Command is in a better position for reaching with one hand to get all of the keys. Try to do a Ctrl-T, and then a Cmd-T. Plus, I can use my thumb for the Command key, meaning I can continue to use the correct finger. Cmd-Q, versus Ctrl-Q.
  2. Save buttons on toolbars. I rarely use the Save Menu, let alone the Print toolbar button. Cmd-S always saves. The only time I use buttons is if I don't know the keyboard shortcut.Multi-button mouse. Every multi-button USB mouse I have ever tried worked first time. Even those that needed a driver for Windows. Like the wireless one that came with my Dell. Trying to use this with another computer without the software installed was hopeless - I had to use the Apple mouse instead. But yes, I'd like to see an Apple styled multi-button mouse.
  3. Only show relevant file types in open and save dialogs. I actually hate that Windows never shows all of the files it can see - Word sticks to only showing Word documents and not Plain Text files by default. And, every time a beginner uses Windows, and uses Excel for the first time instead of Word, they think they've lost all of their files. And freak out.
  4. Sort folders on top of directory listings. I'd be surprised there isn't a hidden setting using defaults for this one. Yes, I agree.
  5. More context sensitive help. Actually, my take on this is get rid of the stupid help key on the keyboard. I've hit this more times than I care to remember when I go to hit Delete. And then Help opens up, telling me stuff I already knew, and not deleting what I wanted to delete.
Overall, I disagree with just about everything said in the article.

How long have you iTunes-d?

I like the bit that appears at the bottom of iTunes, telling you how much music you have in your collection (or in the current playlist). iTunes Library Size I thought it might be fun to see how much music I had listened to. As it turns out: 5883 songs, 17:13:27:05 total time. Here is the script I wrote to find it out.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    #! /usr/bin/env python
    
    import Foundation
    import os
    
    library =  os.path.expanduser('~/Music/iTunes/iTunes Music Library.xml')
    
    db = Foundation.NSDictionary.dictionaryWithContentsOfFile_(library)
    tracks = db[u'Tracks'].itervalues()
    
    timecount = 0
    playcount = 0
    
    for track in tracks:
        try:
            timecount = timecount + track[u'Play Count'] * track[u'Total Time']/1000
            playcount = playcount + track[u'Play Count']
        except KeyError:
            pass
    
    days, timecount = timecount / (60 * 60 * 24), timecount % (60 * 60 * 24)
    hours, timecount = timecount / (60 * 60), timecount % (60 * 60)
    minutes, seconds = timecount / 60, timecount % 60
    
    print '%i songs, %i:%02i:%02i:%02i total time' % (playcount, days, hours, minutes, seconds)

Daring Fireball: About the Footnotes

Daring Fireball: About the Footnotes John Gruber talks about the use of footnotes in blog posts. What strikes me as a good way to do stuff is to have a multi-line abbreviation-style tag, that floats over the text where the pointer is when hovering.1

iTunes Library Checker 2.0

I’ve rewritten most of iTunes Library Checker to use some neater import code, it should also be a bit faster. Not quite complete yet, but close to the previous functionality.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    #! /usr/bin/env python
    
    import Foundation
    import os
    import struct
    
    library =  os.path.expanduser('~/Music/iTunes/iTunes Music Library.xml')
    db = Foundation.NSDictionary.dictionaryWithContentsOfFile_(library)
    libpath = Foundation.NSURL.URLWithString_(db[u'Music Folder']).path()
    
    tracks = db[u'Tracks'].itervalues()
    
    findstr = "find '"+libpath+"' -type f -not -name .aacgained -not -name ._* -not -name .DS_Store | sort"
    treedata = os.popen(findstr).readlines()
    
    missing = []
    other = []
    missing_files = []
    other_files = []
    surplus = treedata[:]
    
    for track in tracks:
        location = Foundation.NSURL.URLWithString_(track[u'Location']).path()
        if not os.path.exists(location):
            missing.append(track)
            missing_files.append(str(location))
        else:
            try:
                surplus.remove(str(location)+'\n')
            except ValueError:
                other.append(track)
                other_files.append(str(location))
        
    missing_files.sort()
    other_files.sort()
    surplus.sort()
    
    open('surplus.txt','w').writelines(surplus)
    open('missing.txt','w').writelines(missing_files)
    open('other.txt','w').writelines(other_files)

Simpler iTunes Library Checker

I posted some code exactly a month ago, then I find this. I will rewrite the code so it is simpler, using the MacOS hooks that come with PyObjC.

Deeper iTunes Data

I came across an interesting question today: Why doesn’t iTunes store all of the data about each time a song is played? And also, how much of the song was played? It should be easy to write a daemon that monitors iTunes, and writes this data to a database. This database can then be cross-referenced against the iTunes database for a comprehensive breakdown of when songs are played. You can then find all of the songs that you listen to at a certain time of day, or season, and so on. You can also have a ‘how-often-played’, but cross referencing the Date Added attribute with the Play Count and so on. I’ve already started to write this program, but it will likely be MacOS X only.

How Accurate is the iTunes Counter?

I got a comment to a post that had nothing to do with iTunes. Whilst it wasn’t a particularly helpful or nice comment, I thought maybe I can answer the question I think he’s asking. (Unless he’s talking about the iTunes Music Store counter that shows how many songs have been bought for the latest contest…). Wach time you finish playing a song, the Play Count field is incremented, and the Last Played date is updated. If you skip a song before listening to the entire track, neither of these are updated. There are some scripts around for MacOS AppleScript that will update a Play Count and Last Played if you listen to more than a certain amount of a track. I could also add the same feature to iTunes Rater. But I don’t really use Play Count and Last Played that often, anyway.

Still No Joy (XML-RPC)

I’m still not able to post with ecto on Blogsome: some of the functionality is there, but I get an error on posting. I might try MarsEdit or something else and see if that works, as w.bloggar does, apparently. I’ve also stopped using Dvorak keyboard layouts, as it takes too long to learn to type, and I hate not being able to keep up with my thoughts.

Poaching Eggs

I read about some guy’s aim to poach an egg. It’s much simpler than this: just boil some water in a saucepan, with a little white vinegar added. When boiling, stir the water gently and break the egg into the pan. Use a slotted spoon to keep the shape, and to remove the egg when done. When you get good at it, you can try more than one egg at a time. (Not many words here due to Dvorak layout.)

Dvorak Keyboard Layout

Back in the heady days of BeOS, I at one stage taught myself how to type reasonably well using a Dvorak keyboard. I’ve clearly forgotten most of it. This was typed (slowly) on a Dvorak layout. I am getting faster, and more accurate, though. Using the CLI program dvorak7min will get me back up to speed soon, I hope.