02)ファイル選択choose file

| コメント(0) | トラックバック(0)

ファイルを選択します。choose fileで選ぶとalias型の値で返ってくるのでas stringで型変換するとテキスト形式のフルパスが返ってきます。その後なんらかの処理を(InDesignに配置するとかテキストを読み込むとか)すればOKです。

set this_item to choose file with prompt "配置ファイルを選択"
set Fpath to this_item as string--ファイルのフルパスをテキスト形式で取り出す
display dialog Fpath--表示する。

下記ではファイルタイプが"EPSF"か"EPSP"かまたは種類が"EPS ファイル"のファイルだけ処理関数に渡すといったちょっと気の利いた事をしています。下記では処理関数setEPS2を呼び出しています。

set this_item to choose file with prompt "配置ファイルを選択"
set Fpath to this_item as string--ファイルのフルパスをテキスト形式で取り出す
set Finfo to info for this_item--ファイルインフォメーションを取り出す
set FType to file type of Finfo
				--ファイルインフォメーションからファイルタイプを取り出す
set Fkind to kind of Finfo--ファイルインフォメーションから種類を取り出す
if FType is "EPSF" or FType is "EPSP" or Fkind is "EPS ファイル" then
	my setEPS2(this_item, Fpath)--処理をする。
end if

トラックバック(0)

トラックバックURL: http://www.adg7.com/mt/mt-tb.cgi/32

Comments are nofollow setting

コメントする

エントリー一覧

OpenID対応しています OpenIDについて
Powered by Movable Type 7.902.0
漢字イラストロジック-脳トレ京
FREE ONLINE SUDOKU