12)オーバーフローを調べる

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

paragraphを合体したもの(全テキスト)とlineを合体したもの(見えているテキスト)を比べてオーバーフローしていたら警告する。

tell application "Adobe Illustrator"
	tell document 1
		repeat with tFrame in every text frame
			if kind of tFrame is {area text} then
				if my overflow(tFrame) then
					display dialog "オーバーフロー:" & contents of tFrame
				end if
			end if
		end repeat
	end tell
end tell

on overflow(tFrame)
	set OriginalDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to ""
	tell application "Adobe Illustrator"
		set myLastP to (contents of every paragraph of tFrame) as string
		set myLastL to (contents of every line of tFrame) as string
		set AppleScript's text item delimiters to OriginalDelimiters
		if myLastP is not myLastL then
			set AppleScript's text item delimiters to OriginalDelimiters
			return true
		else
			set AppleScript's text item delimiters to OriginalDelimiters
			return false
		end if
	end tell
end overflow

トラックバック(0)

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

Comments are nofollow setting

コメントする

エントリー一覧

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