Matt Neuburg Book on Rb-Appscript

This book is still in beta but has a lot of very good information. Check it out!

Using Scripting Bridge

Rob Napier has written a nice tutorial at Cocoaphony on how to use Scripting Bridge.

Thanks Rob!

Launch AppleScript Scripts From a Webpage Link

Have you ever wanted to get information out of a webpage and work with that information on your computer? There are several techniques that allow you to do this especially if you use Safari. Safari is fairly scriptable and you can execute JavaScript code from AppleScript to talk to the DOM in a Safari window. What do you do though when you use Firefox?

Firefox has only one AppleScript command: OpenURL. This is great if the only thing you ever want to automate is opening Firefox to a specified url. Not likely!

Read the rest of this entry »

PS1 Export Command For GIT

I have been using GIT more and more these days and thought it would be nice if my PS1 command would display if I were in a GIT directory and show the current status whether clean or dirty. First it checks if you are currently in a git repository and then gets the branch name and the status.

Bash PS1 Command

export PS1='$(git branch &>/dev/null; if [ $? -eq 0 ]; then \
echo "\[\e[0;32m\][GIT: \e[0;31m\]$(basename `pwd`); \e[0;33m\]$(git branch | grep ^*|sed s/\*\ //) \
$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; if [ "$?" -eq "0" ]; then \
echo "\e[0;32m\]clean"; else \
echo "\e[0;31m\]dirty"; fi)\e[0;32m\]] \$ "; else \
echo "\[\e[0;31m\][\w]\[\e[m\] \$ "; fi) \e[0m\]'

What it Produces

Ps 1

Some Shell Colors

	Black       0;30     Dark Gray     1;30
	Blue        0;34     Light Blue    1;34
	Green       0;32     Light Green   1;32
	Cyan        0;36     Light Cyan    1;36
	Red         0;31     Light Red     1;31
	Purple      0;35     Light Purple  1;35
	Brown       0;33     Yellow        1;33
	Light Gray  0;37     White         1;37

GIT Using Unfuddle.com

I have recently switched from subversion to GIT and not only am I incredibly satisfied and excited about GIT I found a really cool website to host my repositories called Unfuddle. I know most everyone is suggesting GitHub and I can see the benefits for certain projects but what about projects I need to keep private. With GitHub you have to purchase an account to have private repositories but not on Unfuddle.

Read the rest of this entry »

TextMate: Make Project from Open Files

Have you ever wanted to take all or a selection of open TextMate files and group them in a Project? I have. So much so that I created this Ruby script to do just that!

Read the rest of this entry »

Xcode Script to Insert Pragma Line

Type in the title of your pragma mark, select it and run this script from the scripts menu or give it a keycode.

I use this script to help me with consistency in my code.

Alter the script to make the pramga look the way you like!

Read the rest of this entry »

Becoming Productive in Xcode Videos Available!

Pragmatic Programmers just released a new series of videos, “Becoming Productive in Xcode”, by Mike Clark.

I just finished watching them and they are awesome! I thought I was getting a lot out of Xcode but these videos showed me there is so much more. Read the rest of this entry »

Saving Selected Text and URL From Safari to a File

One thing I do everyday is surf the web. I bet you do too. Sometimes I find information, snippets of code or just something useful and I would like to save that information for later use.

I use a FileMaker database to store this information and I extract the data from Safari using AppleScript. Since everyone does not own a copy of FileMaker, this example will demonstrate extracting the info from Safari and writing it to a file on your desktop. Read the rest of this entry »

Safari Selection to TextMate Document

This script extracts the current Safari selection, writes it to a file on your desktop called “tm.txt” and then opens in TextMate.

It is a simple script so customize to your liking. One thing I should note. If you try to open the selected text directly using the “mate” command you may find you have open shell sessions running in the background. Even using “> /dev/null/ 2>&1″ did not free the shell. It was only after I closed the TextMate window that the shell session closed.

If you know how to correct this issue please post it. Read the rest of this entry »

←Older