[TxMt] Calling CodeKit With AppleScript

Robert J. Rockefeller bob at bobrockefeller.com
Tue Apr 28 23:31:31 UTC 2015


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20150428/1e3967a1/attachment.html>


More information about the textmate mailing list