Category Archives: Scripts

A discussion of scripting of applications and tasks. Usually Applescript or Python but occasionally shell scripts.

Hashbanging Swift

Hashbanging Swift. Using Swift at the command line. I had enough issues trying to replace Python with Swift that I went back to Python.

Related Posts

  • 55
    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 very beta. Most of the…
    Tags: swift, python

Using Swift as a Scripting Language

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 very beta. Most of the bugs I’ve submitted appeared to have been fixed but I’m somewhat loath to get too far into Swift until it gets a little more mature. Say at least beta 3 or 4. However here’s my thinking although this is somewhat preliminary. I’ve just not tried to use Swift as a practical scripting language.

Continue reading

Related Posts

  • 55
    Hashbanging Swift. Using Swift at the command line. I had enough issues trying to replace Python with Swift that I went back to Python.
    Tags: swift, python
  • 46
    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…
    Tags: scripts, scripting, code, swift, python
  • 45
    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…
    Tags: swift, scripting
  • 42
    Someone’s written an other great library for Swift: Pythonic. (HT: Oluseyi on ADN) It adds most of the commonly used standard Python library to Swift. I confess I’ve been learning Swift by recreating the Python library calls that I regularly use. Mine was definitely an exploratory work though. I was mainly working in a Playground. Half the code…
    Tags: swift, python, code

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

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 very beta. Most of the…
    Tags: swift, python, scripts, scripting, code