2008年3月1日土曜日

ScriptingBridgeについて

使うためにそのためにはヘッダーの生成が必要になる。
下記のスクリプトで作るようにした。


#!/bin/sh
set -e

echo "Make SB Header"

if [ ! -d "/Applications/$1.app" ]; then
echo "Application Not Found"
exit 1
fi

echo $1
sdef /Applications/$1.app | sdp -fh -o $1.h --basename $1 --bundleid `defaults read /Applications/$1.app/Contents/Info CFBundleIdentifier`


このスクリプトはxcodeのターゲットルールでも対応できる。

sdef "$INPUT_FILE_PATH" | sdp -fh -o "$DERIVED_FILES_DIR" --basename "$INPUT_FILE_BASE" --bundleid `defaults read "$INPUT_FILE_PATH/Contents/Info" CFBundleIdentifier`

てなかんじで。

なかなかScriptingBridgeでおもしろいことが面白いことができそうなので。

0 件のコメント: