News for hackers. Stuff that matters.
Re:Using Spotlight from the OS X Commandline by _pdeschen on Sunday July 15, 2012 @08:52PM (#4248800)
It's nice to have access to such UI components from the command line.

One of my favorite is pbpaste/pbcopy.

What's yours?

Re:Using Spotlight from the OS X Commandline by bpierre on Sunday July 15, 2012 @10:27PM (#4249041)
`open` is very convenient to… open things (see `man open`).

Tip: `open .` opens the current directory in the Finder.

Re:Using Spotlight from the OS X Commandline by jasomill on Monday July 16, 2012 @12:13AM (#4249270)
Another tip:

    open vnc://[user@]host[:port]
connects as user to host on port with Screen Sharing, and, more generally, "open URL" works for any URL scheme registered with Launch Services, including, but not limited to, the obvious ones.
Re:Using Spotlight from the OS X Commandline by elithrar on Sunday July 15, 2012 @09:41PM (#4248932)
$ softwareupdate -i -a [install, all] as it avoids the (slow) UI and you can schedule it if you want to.

Not sure if it'll carry across to ML, what with updates going through the Mac App Store there.

Re:Using Spotlight from the OS X Commandline by activepeanut on Sunday July 15, 2012 @10:11PM (#4249002)
One downside worth mentioning is that you can't read the full description of each available updates, like you can when you click on an item in the GUI version.
Re:Using Spotlight from the OS X Commandline by jasomill on Sunday July 15, 2012 @11:34PM (#4249193)

    softwareupdate -d -a
downloads all updates to /Library/Updates. For each update, you get a .pkg file to install and a metadata file that includes this description.
Re:Using Spotlight from the OS X Commandline by _pdeschen on Sunday July 15, 2012 @10:27PM (#4249037)
Indeed. Moreover, I only want to update my jdk when Im ready and have some free time to repair my jdk 1.5 symlinks once the update completes.
Re:Using Spotlight from the OS X Commandline by jasomill on Sunday July 15, 2012 @11:42PM (#4249207)

    osascript
of course: it lets you control the UI of Cocoa applications, and even more for scriptable ones:

    osascript -e 'tell application "Safari" to close every document ¬
                  whose url contains "news.ycombinator.com"'
(¬, option-(lowercase L), is the AppleScript line continuation character)
Re:Using Spotlight from the OS X Commandline by riobard on Sunday July 15, 2012 @09:49PM (#4248946)
`security` lets you manipulate your Keychains.

`say` lets you do text-to-speech in command line.

Re:Using Spotlight from the OS X Commandline by Watabou on Sunday July 15, 2012 @11:14PM (#4249134)
say is pretty useful and fun. When I'm compiling or just telling the Terminal to do something tedious, I add a say command at the end and it will notify me when it's done.

For example, if I want to install mercurial and git with homebrew:

brew install git mercurial; say "The task is finished, Master."

Re:Using Spotlight from the OS X Commandline by Tarlitz on Monday July 16, 2012 @11:07AM (#4250989)
A more silent option is to print the bell character to the terminal, ie.: sleep 5; printf '\a'

This will cause the terminal to bounce and add a little badge with the number of tasks that require your attention if it's out of focus :)

Re:Using Spotlight from the OS X Commandline by jasomill on Monday July 16, 2012 @12:28AM (#4249309)
As an aside, in Lion at least, you can download high-quality voices for dozens of languages in Speech Preferences (including the ones Apple uses for Siri in several countries).
Re:Using Spotlight from the OS X Commandline by riobard on Monday July 16, 2012 @10:30AM (#4250844)
I used to SSH into my wife's Mac and asked her to come over if we are in different rooms :)