Category Archives: Applescript

Fix TV Shows MetaData in iTunes

It’s been a while since I’ve done a good script here. My apologies. Life’s been busy. Here’s a good one some of you might like. 

For a long time I’ve been using Identify to look up metadata for videos in iTunes. It worked reasonable well. Of late though it hasn’t worked as automatically as it used to. Far too often I have to swing over to my browser, do a search in IMDB and copy the media ID from the URL, add it to Identity and then make Identify look again. That wasn’t that bad although it was kind of defeating the point of the app somewhat. Then the last few months I found it wasn’t even finding metadata for TV shows even when I put the media ID in from IMDB. Since most of what I rip are TV shows this was more than annoying.

Several people at the Ars Forums suggested I switch to Subler. This is nice as Subler’s an open source app. The one downside is that Subler is really overkill for what I’m doing. It’s designed to do a lot of the same thing that Handbrake does. In fact you can use it in place of Handbrake quite regularly depending upon what you’re doing. The problem is that Subler’s metadata tagging is really designed to be done before you add your file to iTunes. If you’re trying to fix metadata in iTunes it’s not nearly as convenient. You can do it, but it would be nice to automate the steps so you can simply select a few dozen files from a DVD rip and let it go. 

Continue reading Fix TV Shows MetaData in iTunes

Related Posts

  • 47
    Well most of my predictions have already been falsified for WWDC. Apple appears to have leaked news that there won’t be a new Apple TV. It’s an odd leak, if that’s what it is. It appears like Apple had planned for new hardware and a new UI but it just wasn’t…
    Tags: apple, tv
  • 41
    Michael Tsai has a great roundup of views of Apple’s Music Connect service. That’s the tab that puts you in contact with various bands. He didn’t quote it, but apparently the posting process is rather clunky. I tend to agree with those who find this underwhelming. I don’t think I…
    Tags: apple, itunes

Sync Folder to iTunes

An interesting script to sync a folder to itunes. (HT: Rocket Ink) I don’t think I’d want to use it due to the problems of deleting entries from iTune if the track isn’t in the file system right then. (Yes, I speak from experience – but it’s an even bigger problem I suspect with iTunes Match) 

Related Posts

  • 55
    Michael Tsai has a great roundup of views of Apple’s Music Connect service. That’s the tab that puts you in contact with various bands. He didn’t quote it, but apparently the posting process is rather clunky. I tend to agree with those who find this underwhelming. I don’t think I…
    Tags: itunes
  • 51
    The first thing I had to realize trying out Apple’s new Music service is that you have to rearrange how you think about iTunes. I’m one of those folk who threw up their hands in frustration when iTunes 11 came out with a quasi-iOS look and got rid of multiple…
    Tags: itunes

Swift with Cocoa Applescript

Using Swift with ApplescriptObjC and Cocoa-AppleScript.

Seems like a nice tutorial although I’ve not tried it yet. (Quite busy) I’d tried to get this same thing working during the summer and never did. Maybe I’ll give it an other whirl. It’s pretty close to what I tried. Effectively you’re mixing the old way to mix Applescript and ObjC together and throwing a little Swift in the mix.

I think Swift would be a fantastic replacement for Applescript if there was a simple non-convoluted way to run scripts. Something on par with Python + Appscript. (What I used to use for all my scripting)

I should note that I’ve tried using Apple’s Javascript replacement for Applescript. However I do a lot of GUI scripting in most of my scripts and for some reason Javascript didn’t like some of those GUI objects. 

Related Posts

  • 60
    I’d mentioned in passing in one of my Swift posts about using it as a scripting language. Someone on Twitter asked me if I’d convert from using Python to Swift for my scripts. It’s an excellent question that I really can’t answer fully at this stage. The language is still…
    Tags: swift, python, scripts, scripting
  • 41
    Nick Lockwood has one of the best discussions of Swift exceptions I’ve found both in terms of design, problems and benefits.
    Tags: swift, ve

Swift & ApplescriptObjC

OK this one is a bit silly. However I was curious if I could use ApplescriptObjC with Swift. Why? Mainly giggles and also to see if there was an easy way to bridge certain stuff from Applescript but do my actual scripting in Swift. The trick to calling ApplescriptObjC objects from Cocoa is to create a protocol, use NSClassFromString, instantiate from the returned class your object, and then call your method. (Which is actually an Applescript routine) The problem is that while Swift supports creating classes with NSClassFromString there’s no way to instantiate a class so returned. I played around with it a long time. The best solution is really a wrapper class in ObjC that calls the ApplescriptObjC methods that you can call from Swift.

Continue reading Swift & ApplescriptObjC

Related Posts

  • 45
    Nick Lockwood has one of the best discussions of Swift exceptions I’ve found both in terms of design, problems and benefits.
    Tags: swift
  • 45
    I’d mentioned in passing in one of my Swift posts about using it as a scripting language. Someone on Twitter asked me if I’d convert from using Python to Swift for my scripts. It’s an excellent question that I really can’t answer fully at this stage. The language is still…
    Tags: swift, scripting

On Adding Applescript

On adding Applescript support to your app. (HT: Brent Simmons) I wish, wish, wish more apps added Applescript support. It makes things so much easier. If you’re doing small business software you absolutely should do this. Not because your clients will write Applescript but because they’ll get people to do it for them for automation. Especially to do repetitive actions with Keyboard Maestro. (I wish Daylite has better scriptability)

My Scripts

Over at the old blog many of my posts were focused around automation and especially scripting. My scripting language of choice was Python + Appscript. Appscript is no longer supported (although I keep using it) I have switched to using a few more Applescript scripts, but I really hate that language even though I love the idea of Apple Events. I find it sad that fewer and fewer applications really are support scripting via Apple Events. I’m hoping the announcement of Javascript for Applescripting will improve this. I know I’m not alone in disliking the Applescript language while loving a lot of the technology behind it.1

Most of my scripts haven’t been updated in a while, but I try and keep the main ones on GitHub for others to use. As I make significant updates I’ll update the GitHub versions. So if you are interested in my scripts, please check out that repository. Now that Swift is becoming a bit more mature I may try doing some scripts with it in the future.

Continue reading My Scripts

  1. My favorite joke along these lines is that Perl is a write only language because anyone can writes something in it but it’s nearly impossible to read someone else’s code. (This was in the days of Perl 3) Applescript is a read only language because it’s trivial to read a program and figure out what it does but nearly impossible to easily write a script in it.

Related Posts

  • 46
    I’d mentioned in passing in one of my Swift posts about using it as a scripting language. Someone on Twitter asked me if I’d convert from using Python to Swift for my scripts. It’s an excellent question that I really can’t answer fully at this stage. The language is still…
    Tags: swift, python, scripts, scripting, code