[TxMt] Re: Calling CodeKit With AppleScript

Allan Odgaard mailinglist at textmate.org
Wed Apr 29 14:46:59 UTC 2015


On 29 Apr 2015, at 1:31, Robert J. Rockefeller wrote:

> So I wrote this:
>
> #!/bin/bash
> 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.

This is probably more of a CodeKit issue.

Normally you would use: `POSIX file "$TM_PROJECT_DIRECTORY"`.

But given the command is `containing path` then perhaps it does expect a 
string? Though in the bit you quoted from the documentation it uses a 
tilde in the path, which is a bit weird, if it’s a subset search.

For testing you could do this:

	#!/bin/sh
	osascript <<EOF
	tell application "CodeKit" to display alert "Test" message 
"$TM_PROJECT_DIRECTORY"
	EOF

This should show if the expected string is actually obtained.


More information about the textmate mailing list