Languages to program on mac, and applescript?

Discussion in 'Mac Programming' started by vim-espresso, Jul 14, 2012.

  1. vim-espresso macrumors newbie

    Jul 14, 2012
    United Kingdom
    I am new to mac. I can code in a lot of languages for windows and linux, but personally I feel rather young again using mac, naive. It has made computing fun again. I am making a list of things I want to learn for fun, first I want to get a list of programming languages to choose from so that I can have a selection of tools for my fun.

    Now to the questions:
    • Is AppleScript still widely used and do your experiences teach that it is a good tool to learn, or is bash scripting better?
    • What programming languages for mac are commonly used other than objective-c? (Objective-C already top of list to work towards competence in).

    I thank you for reading, and am grateful for any replies.
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    What do you want to do with the language?

    Woodworkers use many tools: saw, hammer, chisel, etc. No one tool is better than the other, except at a certain task. You could cut boards in half with a hammer and chisel, but that would be tedious and silly.

    A language is a tool. Pick a language to match the task. If you don't have a task in mind, it's hard to pick a language, so any will do. Just don't be surprised if some tasks are difficult.

    Yes, AppleScript is used. So is bash scripting. And each one can run scripts written in the other. The command to run AppleScripts is 'osascript'. The AppleScript command is "do shell script".

    For processing text, the awk language is a good choice. Often neglected and underused, it takes some getting used to. But after you've struggled with the turgid prolixity of AppleScript for what ought to be simple text processing tasks, awk's concision is refreshing.

    All the shell commands have man pages, even the shell itself. Read them. An easy way to do that is Bwana, which opens man pages in your browser.
  3. GorillaPaws, Jul 15, 2012
    Last edited: Jul 15, 2012

    GorillaPaws macrumors 6502a


    Oct 26, 2003
    Richmond, VA
    Another interesting language/tool is the Cappuccino Framework which uses the Objective-J language (a mashup of Objective-C and Java Script) to write web apps that have a very OS X-like feel to them. I would wait until after learning Objective-C and the Cocoa frameworks before messing with it, but it's a neat technology.

    There's also F-Script which is a neat tool for introspecting objects at runtime.

    Then there are hybrid languages like MacRuby which let's you use Ruby to create Cocoa Apps, and PyObjC which is a bridge that allows you to develop Cocoa apps in Python. As I understand it, both of these require solid understanding of Cocoa and Objective-C in order to be useful, and can be a bit tricky to debug, but if you're looking for interesting languages, these might be ones to check out as well.
  4. elvisofdallas, Jul 28, 2012
    Last edited: Jul 28, 2012

    elvisofdallas macrumors newbie


    Aug 11, 2009
    Northwest Louisiana
    Great post !

    Hey - thanks for the info. I'm an old school programmer (primarily using SQL for my RL job), but I've been slowly relearning traditional programming skills and weaving in the Mac-specific stuff.

    AppleScript turns out to be insanely powerful (seems so simple, like the old Logo language that was popularly discussed in the early 80s), but I'm now ankle deep in python, as it seems to be a great tool for automation tasks, especially those that would pull data from the internet.

    Thanks again for the great post - I forget how helpful the people on MacRumors are!!


    ---> edit: question, of those of you with experience in the popular scripting languages (perl, python, even PHP), do you have a preference for rapid coding of things like screen scrapers or data aggregators?

    Thanks in advance - E
  5. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    Python is indeed a great tool. I use it instead of shell scripting, for web sites, database management and general system tasks.

    My scripting language experience is mainly Python but I have used PHP in the past. The one thing I will say is stay as far away as possible from PHP as you can. It is an awful language.

    Python is an excellent choice for screen scraping and data aggregators. Especially scraping websites as you can use html5lib to parse the page and then just treat it like a DOM. If you want to aggregate some data you can use the built in SQLite database API (it is in the standard library) to store your data in an in memory SQL database (or you can save the database to disk if you want the data to be persistent). This allows you all the flexibility of being able to use SQL to query your data. Of course if you want to use a "proper" SQL database you can also use PostgreSQL, MySQL or one of the other commercial databases with Python just fine as well.

    You might find SQLAlchemy useful if you are planning on working with databases alot. Here is the link:

Share This Page