How to run an AppleScript from the Mac OS X Unix shell

AppleScript FAQ: How can I run an AppleScript script from the Mac Unix terminal (Unix command line)?

A cool thing about Mac OS X is that you can run AppleScript programs from the Unix shell. (Well, I guess it's cool if you're a Unix user.)

Running an AppleScript program from the Unix shell turns out to be surprising easy. For instance, if my current working directory has a script named OpenUrls.scpt in it, I can run that script from the command line like this:

Sample Mac Jar Bundler Ant build script

I was going to write a little tutorial on how to use the Jar Bundler Ant task for Mac OS X, but I don't have the time to do that right now.

So, I'll just share my Mac OS X Java Ant build script, which includes the JarBundler task. You should be able to use this Ant build script to build a Java application so it appears to the user to be a native Mac OS X application, even though it's really a Java application under the covers.

AppleScript error: Can't make (handler) into type string

If you ever get the following error message in an AppleScript program (at least while editing the program in the ScriptEditor):

Can't make (handler) into type string

fear not, it seems to be pretty simple to cure. In my case I got this more-specific error message:

Can't make (handler getDayOfWeek) into type string

This error just means that I tried to call a function like this:

How to run JRuby from a Ruby script on a Windows PC

I'm doing some crazy things at the moment, basically calling JRuby from a Ruby script on a Windows 2000 system. I'm doing this because there are a bunch of JRuby scripts that I want to run sequentially, and I also want to check for errors after each run, so what better way to invoke them and look for resulting errors than with Ruby, especially on a Windows system? :)

How to open a Mac OS X Terminal in the current Finder folder

Mac OS X Terminal/Finder tip: This tutorial shows how to open a Mac Terminal window in the current Finder folder by using AppleScript.

For a while I have wanted to be able to open a Mac Terminal window in the same directory as the Mac Finder folder that I’m currently looking at. I couldn’t find any other way to do this, so I finally wrote an AppleScript script to do it. Fortunately the script is pretty simple. Here's the code:

Syndicate content