I’m trying to create a command using AppleScript to open CodeKit and select the CodeKit project associated with the current TextMate 2 project.

CodeKit’s docs want this:

tell application "CodeKit" to select project containing path "~/clients/aProject/app.scss”

So I wrote this:

#!/bin/bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"

osascript <<EOF 
tell application "CodeKit" to select project containing path "$TM_PROJECT_DIRECTORY"
EOF

That launches CodeKit but does not select the project; CodeKit opens to the last used project, not $TM_PROJECT_DIRECTORY.

I’ve tried both “TM_PROJECT_DIRECTORY” and "’$TM_PROJECT_DIRECTORY’”.

What did I get wrong?

Bob
-------------------
Robert J. Rockefeller
Richmond Hill, GA
www.bobrockefeller.com