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

Multi-Item Edit

The more I use iTunes 12 the more I find equal parts annoyance and happiness. There are a lot of little UI fixes I wished they’d done years ago. Yet, continuing the process started by iTunes 11, heavy tagging by power users has become more difficult. In particular using the Get Info window to tag numerous files with the same tag no longer works. Fortunately Multi-Item Edit from Doug’s AppleScripts comes to the rescue. This gives you a window akin to the old school Get Info window to make batch changes in iTunes.

Continue reading Multi-Item Edit

Related Posts

  • 44
    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
  • 42
    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

Get Old Get Info

Get the old Get Info window back in iTunes 12. I actually prefer the new one, but I agree that having to click “add field” is annoying.

Related Posts

  • 59
    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
  • 57
    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, click
  • 42
    The betas for Yosemite have been out for a while. The public beta started last week. I think that the betas are mature enough to actually use regularly and give some thoughts on. Not everything is stable of course. For instance messages using your phone to enable calling phone numbers…
    Tags: itunes, window

iTunes 12

Tidbits has a good post on iTunes 12’s interface.

I don’t think it’s as bad as some. But let’s be honest. 11 was a huge step back from 10 — not the least of which was losing multiple windows. I like how they’ve cleaned it up compared with 11. That said I don’t understand why they changed some things and left long standing annoyances. If you’re going to change the Get Info window as much as they (and it looks fantastic) at least get rid of its modal behavior. There are several annoying bugs such as several of my TV shows not having artwork show up properly. I’m sure they’ll fix that quickly though. My biggest complaint is that several tagging apps like Identify stopped working with it.

Dial Daylite Number

One of the things I was excited for in Yosemite was dialing numbers on my iPhone from my Mac. In particular I really wanted my CRM app, Daylite, to support Yosemite dialing. Unfortunately it doesn’t. You can still only call via Skype or Dialectic.

To fix this I wrote a quick little script that utilizes Yosemite to dial the current number. I’ve been trying to move away from my traditional Appscript + Python to do my scripting since Apple script isn’t supported anymore. So this is pure Applescript with all the pain that entails.1 

Since this involves GUI scripting it’s a lost cause trying to explain it too much. Basically it just checks to see if the view is in Company mode or People mode and gets the phone number from the associated UI element. It checks the mode by looking at the value of the button on the top of the window. When you’re in Company mode it’ll say “New Company” and in People mode it’ll say “New Person.” I use a “try” block so it doesn’t fail in an ugly way if you’re in some other mode.

It’s not perfect since you can have a pop up person when in Company Mode. I’ll probably add that condition in later if I find the time.

Continue reading Dial Daylite Number

  1. I actually tried to do it in Javascript but Apple’s Javascript doesn’t work well with UI scripting. At least I couldn’t get it to function correctly for getting values.

Followup on the Event

Sorry, been quite busy of late. Just a bit of followup on last week’s event.

Continue reading Followup on the Event

Related Posts

  • 72
    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, wwdc
  • 50
    This is the third in my prediction posts. Note I don’t take these too seriously. I’m usually doing well if I bat .500. I’m excluding Apple TV predictions which had their own post as I’m convinced Apple’s updating the hardware. The real question is whether Apple is going to take…
    Tags: apple, wwdc, tb, hardware
  • 48
    This is the second of my WWDC predictions focusing in on iOS. Obviously given the amount of shared code a lot of this will apply to OS X as well. My Apple TV WWDC predictions can be found here. My old iOS9 wishlist can be found here. I think this…
    Tags: apple, ios, ll, ipad, year, wwdc
  • 44
    Michael Tsai always has the best WWDC link roundup. 
    Tags: wwdc

A Long Time Coming

Against my better nature, let me make some predictions for next week’s Apple event. I had low expectation for the iPhone event because most was pretty easy to figure out months earlier. The only surprised was Apple Pay but that didn’t really excite me much. This event, even though it’s not as “big” as the iPhone event seems much more intriguing.

First off and much to my surprise, it seems like retinal iMacs are coming. I had not expected them before ’15.1 There’s enough smoke around the 27” that I think it’s fairly sure there’s fire. That surprises me. I had thought the 27” would be the last one to get retinal. Rumors are the 24” won’t get it at all. I’m not so sure. A lot depends upon pricing. Somehow I can’t see a 27” retinal iMac price matching the current 27” iMac. A 24” retinal iMac might be more affordable for those who want retinal in a desktop. On the other hand a $5000.00 27” iMac is pretty doable – more so than perhaps a $3000.00 24”. 

Continue reading A Long Time Coming

  1. That might still be the case. The 2012 27″ iMac, which I own, didn’t end up becoming available until January. I got mine in April. It’s still a fantastic machine. One of my favorite Macs of all time. But they might announce the retinal iMac and not have it appear until as late as February.

Related Posts

  • 53
    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
  • 47
    Lots of stories that Apple’s TV like service is postponed at best to 2016. Since Apple’s been working on this for years but networks like Fox, NBC & CBS don’t want a deal I think we can probably say the deal will never happen. The problem is that the economics…
    Tags: apple, tv, people, will, price, coming
  • 40
    I’ll skip the discussion of the watch because as I said yesterday, I’m just not that interested in it. If you are go for it. Just be aware that traditionally 1.0 hardware releases from Apple age quickly. The original iPhone, iPad and MacBook Air became obsolete rather quickly and were…
    Tags: apple, ll, air, people, will, retinal, $

Problem of Yearly Releases

Gigaom has a good post on the problem of yearly releases. iCloud drive is a mess since there’s not a simultaneous Yosemite and iOS8 release. Honestly though the signs of change are there. With iOS8 there are major changes coming with 8.1 (Apple Pay) and then large 8.2 and 8.3 releases. (One of which will be the watch release) Ideally we’d stop syncing phone releases with the major OS release.

Ideally we’d have WWDC in March and then the iOS release in August and the phones released the end of September but with major releases – 3 or 4 – throughout the year with major features that don’t require a lot of developer work to integrate. Heck, remember the year OSX’ new release was announced in January with betas in February? We need more of that.

The other thing we need is something akin to Snow Leopard again. Those of you who’ve been using Macs a long time remember that was the release that didn’t add many, if any, noticeable features. But it did clean up all the internal code.

Continue reading Problem of Yearly Releases