03)用語辞書の調べ方

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

AppleScriptからアプリケーションをコントロールするときは用語辞書を見て使えるコマンドやセットできるプロパティを調べます。
用語辞書を見るにはまずスクリプト編集プログラムのウィンドウメニューからライブラリを選びます。ライブラリウィンドウ上部の+ボタンをクリックしてInDesignやIllustratorを選択します。ライブラリウィンドウに登録されたらダブルクリックしてください。用語辞書が開きます。
試しにAdobe Illustrator Suiteのクラスでtext frameを見てみましょう。
as4-3.jpg

Class text frame: Text frame item
Plural form:
	text frames
Elements:
	character by numeric index, as a range of elements, 
				before/after another element, satisfying a test
	insertion point by numeric index, as a range of elements, 
				before/after another element, satisfying a test
	line by numeric index, as a range of elements, 
				before/after another element, satisfying a test
	paragraph by numeric index, as a range of elements, 
				before/after another element, satisfying a test
	text by numeric index, as a range of elements, 
				before/after another element, satisfying a test
	word by numeric index, as a range of elements, 
				before/after another element, satisfying a test
Properties:
	<Inheritance>  page item  [r/o]  -- subclass of page item
	properties  record  
		-- all of this object's properties returned in a single record
	anchor  list  
		-- the position of the anchor point (start of base line for point text)
	column count  integer  
		-- the column count in the text frame (area text only)
	column gutter  real  
		-- the column gutter in the text frame (area text only)
	content variable  anything  
		-- the content variable bound to this text art item
	contents  Unicode text  
		-- the text contents of this text frame
	end T value  real  
		-- the end position of text along a path, as a value relative to 
		   the path's segments (path text only)
	flow links horizontally  boolean  
		-- Flow text between linked frame horizontally first. (area text only)
	kind  area text/path text/point text  [r/o]  
		-- the type of a text frame item
	matrix  matrix  [r/o]  
		-- The transformation matrix of the text frame object
	next frame  text frame  
		-- the linked text frame following this one
	optical alignment  boolean  
		-- is the optical alignment active?
	previous frame  text frame  
		-- the linked text frame preceding this one
	row count  integer  
		-- the row count in the text frame (area text only)
	row gutter  real  
		-- the row gutter in the text frame (area text only)
	selection  a list of text  [r/o]  
		-- the selected text (ranges) in the story
	spacing  real  
		-- the amount of spacing (path text only)
	start T value  real  
		-- the start position of text along a path, as a value relative to 
		  the path's segments (path text only)
	story  story  [r/o]  
		-- the story of the text frame
	text orientation  horizontal/vertical  
		-- the orientation of the text in the frame
	text path  text path  [r/o]  
		-- the path for the text frame (area and path text)
	text range  text  [r/o]  
		-- the text range of the text frame

大量にでてきますが--より右に書いてあるのが解説です。
Elementsは要素です。character(キャラクター)が書いてありますが、text frameの要素にcharacterがあるということです。これをスクリプトにすると下記のようにさらに深い階層になります。characterの用語辞書はText Suiteに書かれています。

tell application "Adobe Illustrator"
	tell document 1
		tell text frame 1
			tell character 2
				get properties
			end tell
		end tell
	end tell
end tell

Propertiesがプロパティですね。この値を変更することによって、Illustratorを操ることが出来ます。

contents  Unicode text  -- the text contents of this text frame

はプロパティcontentsの値はユニコードテキストだということと、--以下の説明をみるとtext frameの内容だということがわかります。

row count  integer  -- the row count in the text frame (area text only)

というのはrow count(段組みの段数)がinteger(整数)で返ってくることがわかります。 [r/o] と書いてあるのはread onlyのため変更することは出来ません。

kind  area text/path text/point text  [r/o]  -- the type of a text frame item

kindというのは種類でarea textかpath textかpoint textで値が返ってきます。テキストボックスを作ればarea textでクリックして文字を作ればpoint textで、ベジェ曲線に沿うようなのはpath textです。こちらも[r/o]なので変更不可です。(実はIllustrator10では変更できましたが変更すると変な形になっていました。)

トラックバック(0)

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

Comments are nofollow setting

コメントする

エントリー一覧

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