2006-02-01から1ヶ月間の記事一覧

Action::getRequestMethods()の返り値の場合

返り値 get時 post時 REQ_POST getDefaultView Execute REQ_GET Execute getDefaultView REQ_GET|REQ_POST Execute Execute REQ_NONE getDefaultView getDefaultView REQ_GET|REQ_POSTがデフォルト

自分のいるディテクトリを返す

getCwd(path to me) on getCwd(thePathToMe) set thePath to POSIX path of ((thePathToMe) as string) as string set theCwd to do shell script "perl -e '?"" & thePath & "?"=~ m@^(.+/).+/?@;print $1;'" return theCwd as string end getCwd

ファイル指定まとめ

俺々ルール POSIXパスの文字列で取り扱う。 ディレクトリは"/"で終わる。 "/hoge/moge/" -- ディレクトリ "hoge/moge" -- ファイル パッケージ化されたファイルをfileパスに変換するとディレクトリ扱いになる(あたりまえ) "/hoge/moge.app" as POSIX file …

script editorを使ってコンパイル

on writePropAndSaveAppBundle(theProp, theSrcPath, theDestPath) if isExistsItem(theDestPath) = false then do shell script "touch " & theDestPath end if tell application "Script Editor" activate open theSrcPath as POSIX file if theProp is no…

DBD::mysqlのインストール

DBD::mysql 3.0002_4はmakeできなかった。 ので、DBD-mysql-2.9005をソースからインストール $ perl Makefile.PL --testdb=test --testuser=user \ --testpassword=pass --mysql_config=/usr/local/mysql/bin/mysql_config $ make $ make test $ sudo make …

DBD::Pgのインストール

cpan> install DBD::Pg

cpan

使い方 $ sudo perl -MCPAN -e shellモジュールの一覧 perl -MCPAN -e 'CPAN::Shell->r'古くなっているモジュールの一括アップデート sudo perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

4.4.2インストール

php

GD_Library1.0_OSX104.zip gd関連のインストール(zlibはインストール不要)手抜き、、http://www.magic3.org/postgrex/ "--with-zlib-dir"でディレクトリを指定するとpearが正常に動かない。(pear installすると、 ダウンロード後に固まってしまう) gcc4.…

インストール

面倒なので、"自分"で動かす $ ./configure CFLAGS=-O2 --prefix='/usr/local/pgsql-x.x.x' --with-rendezvous \ -enable-multibyte --enable-syslog $ sudo make install $ sudo mkdir /usr/local/pgsql-x.x.x/data $ sudo chown oppara /usr/local/pgsql-…

インストール

$ ./configure --prefix=/usr/local/mysql-x.x.x \ -with-mysqld-user=mysql \ -with-extra-charsets=all \ -with-charset=ujis $ sudo make install $ cd /usr/local/mysql-x.x.x/ $ sudo cp ~/src/mysql-x.x.x/support-files/my-medium.cnf /etc/my.cnf…

とにかくposixパスの文字列をかえす

on getPosixStr(theItem) if class of theItem is string then if theItem contains ":" then return (POSIX path of theItem) as string else return theItem end if else if class of theItem is Unicode text then return theItem as string else return …

osacompile

詳しくは、man osacompile $ osacompile -o 保存するファイルのパス 読み込むファイルのパス保存するファイルを*.appにするとアプリケーションバンドルで保存される。 (ScriptEditorで保存したのとInfo.plistがちょっと違う) 読み込むファイルは、*.scptで…

ドロップレットからshell scriptに渡す前処理

on open theList set thePath to POSIX path of (item 1 of theList as string) display dialog thePath end open `

1ボタンのみのdisplay dialog

-- okボタンのみ on dispOk(theMessage) display dialog (theMessage) buttons {"OK"} default button "OK" giving up after 20 end dispOk -- cancelボタンのみ on dispError(theMes) display dialog theMes buttons {"Cancel"} default button 1 end dispE…

指定フォルダ内の拡張子がtheExtensionなファイルリストの取得

on getFileList(thePosixPath, theExtension) set theList to {} set theFilePath to thePosixPath as POSIX file set theFileList to list folder theFilePath repeat with curItem in theFileList if curItem contains theExtension then set end of theLi…

ファイル、フォルダの存在確認

そのまんまがあった...orz tell application "Finder" exists 参照 ende tell on isExistItem(thePosixPath) try set theFilePath to thePosixPath as POSIX file set theAliasPath to theFilePath as alias return true on error return false end try end …

Property Lists

Examining and Modifying Property Lists IFPkgFlagFollowLinksがデフォルトでfalseなんだ、、

perlでplistの編集

Mac::PropertyList が何となく使えそう。 #!/usr/bin/perl use Mac::PropertyList; my $my_plist = Mac::PropertyList::create_from_hash( {hoge=>'moge'} ); print $my_plist;実行結果

PackageMakerをターミナルから使う

必要なもの 必須 Files/ インストールするファイルをまとめたもの オプション Info.plist Description.plist Resources/ Japanese.lproj/ 空でも可 License.rtf Welcome.rtf InstallationCheck等のスクリプトファイル background.jpg んで #!/bin/sh PMAKER=…