Vertical Address Scripting Tips 2 of 5          —宛名の縦書き Tipsパート2— 

This is #2 of 5 series Tips about the vertically address scripting (wiki : Horizontal and vertical writing in East Asian scripts).
To use this tips, it is necessary that you have a Japanese version of Adobe InDesign because it use one of the build-in feature of that only available in Japanese version of Adobe InDesign.

As basic knowledge and tips of the vertical address scripting, please refer to my old post regarding the vertical address scripting.

[JP]
これは宛名の縦組みに関するTipsシリーズのパート2です。本Tipsの使用は日本語版のAdobe InDesign使用を前提としています。

また、宛名の縦組みに関する基本方法は過去の投稿「宛名の縦書き」を参照して下さい。

How to assign text with size specification when it should contain several size formatting?

同一フレームに対して割り当てるテキストを、サイズを変更した物と変更してない物で使い分け方

This tips if for user who have below request.
このTipsは以下の様な要望をお持ちのユーザー向けです。

  • Need to display customer address with different size formatting on first line and second line(Only when it require line feed. No need to change the text size when it can display in one line)
  • 改行を要する場合に、二行目のテキストサイズを変更したい。但し、二行目のテキスト数が少ない場合はサイズ変更せず、ある程度のテキスト数を超えた場合にのみサイズを小さくして表示したい。

What you can achieve with this tip?

このTipsで何が出来るのか?

This tips make you able to display variable text with different size on second line when it insert line feed in it.

本Tipsを使用すると、以下の様な改行を含む宛名表記に際して、一行目と二行目のテキストサイズを自動的に変更する事が可能になります。

Preview :
プレビュー:

As you can see in right side text frame, with this script, it can display text not only by inserting line feed when it  need multiple line, but also it can change the size of second line depends on the text length.

ご覧のとおり、本Tipsを使用したケースでは改行を挿入するだけでなく、改行後に続く行に表示されるテキストのサイズを変更する事が可能です。また、このテキストサイズの変更は二行目のテキストの文字数に応じて自動的に変更されるので、少ないテキスト数の場合はサイズ変更せずに二行目を表示します。

Setup
設定方法

Please refer to former post of this series regarding basic setting.

縦組みのテキストフレームに関する基本的設定方法は過去の投稿を参照してください。

  1. Create variables at outside of page layout. Those variables will be used for script.
    ページのレイアウト範囲外にスクリプトで使用するためのバリアブルを作成します。
  2. Create text frame for vertically scripting.
    宛名用に縦組みのテキストフレームを作成します。
  3. Register all frames in DSM-Bridge as variable element.
    (Since this database has multiple column that each column has small part of recipient address. So I made another variable that can integrated 4 column that all records has value in it)
    Please refer to my last postregarding the assignment for Case1 and Case2.
    全てのテキストフレームをDSMブリッジへ登録します。
    (本Tipsは複数の項目にて住所情報を保存しているDBの使用を想定しています。ですので、始めにある程度住所情報を結合して表示するための代替用バリアブル項目([[Address]])を作成しています。またこのバリアブルへの割り当て設置段階で、ハイフン「-」を全角マイナス「ー」に置き換える設定を行います。詳細についてはTips第1弾を参照して下さい)
  4. “Setup for Case3” :
    Open assignment window, and insert additional field in front of assigned database column which should be used in second line. Then specify the font size by using “Font” menu.
    バリアブル[[Case3]]の設定 :
    割り当てウィンドウを開き、二行目に使用するDB項目の割り当て直前に割り当てフィールドを追加します。(フィールドを選択し、右クリックメニューから新規フィールドの挿入が可能です) 次に、挿入したフィールドにて「フォント」タブをクリックし、サイズの指定を行います。ここではサイズオプションを有効化し、サイズに10ptを指定しました。ここでは有効にしていませんが、チェックボックスにチェックを入れる事で、サイズ同様にフォントの種類、色の変更も可能です。
  5. Edit VBScript
    Let’s edit vbscript. I made script that named as “Vertical Script”. Here is the entire of script code.
    VBスクリプトの編集:
    それではVBスクリプトを編集します。前回紹介したVerticalScriptを改変し、以下の様なスクリプトを記述します。

    function VerticalScript()
    	Dim Count
    	Dim Count2
    	Dim Work
    	Dim Work2
    	Dim s
    	Dim t
    		s = Var.GetS("Case1")
    		t = Var.GetS("Case2")
    		u = Var.GetS("Case3")
    		Count = Var.GetS("Case1")
    		Count2 = Var.GetS("Line2")
    		Work = Len(Count)
    		Work2 = Len(Count2)
    		If Work > 19 Then
    			If Work2 > 10 Then
    				Var.PutS "nogtips_Address", u
    			Else
    				Var.PutS "nogtips_Address", t
    			End If
    		Else
    			Var.PutS "nogtips_Address", s
    		End If
    			VerticalScript = Work
    End function
    

    This script handle all text like below.
    If entire address have more than 19 character, and second line has more than 10 character, then it use small size of text for second line. If not, use normal size.
    If entire text less than 20, then use normal size in one line.このスクリプトにより、住所としての文字列全体が19文字を超える場合は、次に二行目のテキストの文字数をカウントし、二行目が10文字以上の場合にはテキストサイズを10ptに変更させます。それ以外の場合はサイズ変更なしの二行目表示となり、そもそも一行で表示可能なテキスト数の場合は、一行で表示させます。

  6. Edit variable property :
    The last thing and most important is to specify the order of variable process. If you didn’t set it, or set wrong order, you will get unexpected result or simply it won’t work. Please set correct order depends on your variable assignment and script that you set.
    バリアブルのプロパティ設定を行う:
    最後にして、一番重要なTipsはバリアブルに対する「値を受け取る順序設定」です。この設定が正しくない、正しい順序で設定されていない場合は、予期せぬ表示結果を得る可能性があります。ですので、確実に順序立てて値を受け取れるように各バリアブルに対してプロパティを設定していきます。


    Here is the exactly order in this sample.

    各バリアブルの値を受け取る順序設定は以下の通りです。

    ”Address” = 1
    “Case1″ = 2
    “Case2″ = 2
    “Case3” = 2
    “Vertical Script” = 3
    “nogtips_Address” =4

    Output Preview
    出力プレビュー

広告

Vertical Address Scripting Tips 1 of 5 —宛名の縦書き Tipsパート1—

This is #1 of 5 series Tips about the vertically address scripting (wiki : Horizontal and vertical writing in East Asian scripts).
To use this tips, it is necessary that you have a Japanese version of Adobe InDesign because it use one of the build-in feature of that only available in Japanese version of Adobe InDesign.

As basic knowledge and tips of the vertical address scripting, please refer to my old post regarding the vertical address scripting.

[JP]
これは宛名の縦組みに関するTipsシリーズのパート1です。本Tipsの使用は日本語版のAdobe InDesign使用を前提としています。

また、宛名の縦組みに関する基本方法は過去の投稿「宛名の縦書き」を参照して下さい。

How to insert line feed depends on the number of character

同一フレームに対して割り当てるテキストを、改行を含んだものと含んでいないもので使い分ける。

This tips if for user who have below request.
このTipsは以下の様な要望をお持ちのユーザー向けです。

  1. DirectSmile automatically puts all value of record that you assigned to variable frame. Then layout of the text is not looking good. Especially, something which should be formatted as much as beautiful, like a recipient address.
    ダイレクトスマイルはテキストフレームに対して、割り当てた値をDBから自動的に流し込みます。
    この様な場合、縦組みのテキストフレームだと、特に見栄えやレイアウトが悪くなってしまう事があります。このレイアウト、組版を調整する事が可能です。
  2. Using “Adobe InDesign Output option”, you cannot use “Shrink” or “Shrink/Grow” option. So it’s not possible to display all text in one line.
    アドビ・インデザイン出力オプションを使用すると、「縮小」または「縮小・拡大」といったテキストフレームに対するオプション設定が使用出来ません。
    この様な場合でも確実に一行でテキストを表示させるというレイアウトが実現出来ます。

What you can achieve with this tip?
このTipsで何が出来るのか?

This tips make you able to display variable text in one line or multiple line depends on the number of assigned text.
このTipsでは、バリアブルテキストの文字数をカウントし、特定の数値より上の場合は、事前に用意した別のバリアブル・テキスト(改行設定つき)を使い、特定の数値以下の場合は改行設定のないバリアブル・テキストを割り当てる方法をご紹介します。
これによって、一行で全体を表示出来るものは、一行で表示させ、改行を要するテキスト長の場合は、任意の場所で改行させる事を可能にます。

Preview :
プレビュー

As you can see above preview, left frame(simple assignment) just puts all text, and when it reach of bottom of frame, it automatically go to next line, and puts rest of text. On the other hand, right side frame automatically insert the line feed after it put first part of recipient address.
上記のプレビューでご覧頂ける通り、左側のフレームは改行設定をせず、単にテキストを縦組みのフレームへ流し込んでいます。一方、右側のフレームは改行を含む設定をしており、改行を要するほどテキストが長い場合に、自動的に任意の位置で改行コードを挿入し、より見栄えの良い表示結果となっています。

Setup
設定方法

  1. At first, it expect that at least you have 2 columns that contain customer address.
    始めに:
    このTipsでは以下の様なデータベースの使用を想定しています。最低でも顧客住所は複数の項目にて構成されている様なDBが本Tipsの使用には必要不可欠です。
  2. Create variables at outside of page layout. Those variables will be used for script.
    後ほど設定するスクリプトから、参照使用する為にInDesignのデザインレイアウト範囲外にバリアブルテキストを作成します([[VerticalScript]], [[Case1]], [[Case2]])
  3. Create text frame for vertically scripting.
    縦書の宛名用に縦組みのテキストフレームを作成します
  4. Register all frames in DSM-Bridge as variable element.
    (Since this database has multiple column that each column has small part of recipient address. So I made another variable that can integrated 4 column that all records has value in it)
    Then, set the assignment for “Case1”
    全てのテキストフレームをDSMブリッジへ登録します。
    (本Tipsでは上述の通り、複数のDB項目にわたって住所情報を保存しています。ですので、始めにある程度住所情報を結合して表示するための代替用バリアブル項目([[Address]])を作成しました。またこのバリアブルへの割り当て設置段階で、ハイフン「-」を全角マイナス「ー」に置き換える設定を行います)
    その上で、残りの住所と結合させたテキストをバリアブルテキスト[[Case1]]へ割り当てます。
  5. We use VBScript to insert code for “Line feed”.
    Code of line feed in VBScript is “vbCrLf
    改行コードの挿入に際しては、VBスクリプトを使用します。
    VBスクリプトでの改行コードは「vbCrLf」です。
  6. Edit VBScript :
    Let’s edit vbscript. I made script that named as “Vertical Script”. Here is the entire of script code.
    VBスクリプトの編集:
    それではVBスクリプトを編集していきます。今回はバリアブル[[VerticalScript]]に対して、以下の様なVBスクリプトを設定しました。

    function VerticalScript()
    	Dim Count
    	Dim Work
    	Dim s
    	Dim t
    		s = Var.GetS("Case1")
    		t = Var.GetS("Case2")
    		Count = Var.GetS("Case1")
    		Work = Len(Count)
    		If Work > 24 Then
    			Var.PutS "nogtips_Address", t
    		Else
    			Var.PutS "nogtips_Address", s
    		End If
    		VerticalScript = Work
    End function
    

    This script automatically count how many character does Case1 has. And if it higher than 24, then it use Case2, otherwise it use Case1.
    このVBスクリプトではバリアブル[[Case1]]に対して割り当てられるテキストの文字数をカウントし、文字数が24字を超える場合は、バリアブル[[Case2]]を使用し、それ以外の場合は[[Case1]]を使用するといった設定になっています。

  7. Edit variable property
    The last thing and most important is to specify the order of variable process. If you didn’t set it, or set wrong order, you will get unexpected result or simply it won’t work. Please set correct order depends on your variable assignment and script that you set.
    バリアブルのプロパティ設定を行う:
    最後にして、一番重要なTipsはバリアブルに対する「値を受け取る順序設定」です。この設定が正しくない、正しい順序で設定されていない場合は、予期せぬ表示結果を得る可能性があります。ですので、確実に順序立てて値を受け取れるように各バリアブルに対してプロパティを設定していきます。Here is the exactly order in this sample.

    本Tipsにおける各バリアブルの値を受け取る順序設定は以下の通りです。

    “Address” = 1
    “Case1” = 2
    “Case2” = 2
    “Vertical Script” = 3
    “nogtips_Address” =4

Result
出力結果

Empty Item Repository —空のアイテムレポジトリ—

Time is money??

[EN]
Today, I’d like to post small tips regarding DirectSmile Integration Server.

When you see empty Item Repository in DSMI Frontend even though everything configured properly, then the reason of you problem could be “Time Setting” of your local computer.

Here is the possible case which cause empty Item Repository.

  1. There are more than 5 mins differences between Server’s time and your local PC’s time.

  2. Enabled “Automatically adjust clock for Daylight Saving Time” option at server, but not on your local machine and vice versa.

    Time Setting

It because DSMI validate the date and time of your local machine, and in the case it doesn’t match with server time, those behavior will appear as result of this mismatching time on both machines.

[JP]
今日はちょっとしたTipsを。

もしDSMIのItem Repositoryにどのアイテムも表示されない場合は、多くのケースではお使いのPCの時間設定が起因しています。

ケース1.サーバーの現在時刻とクライアントPCの現在時刻がが5分以上ずれている

ケース2.サーバー、またはクライアントPCの時間設定にて”夏時間に自動的に調整する”オプションが設定されており、片方では設定されていない。

どちらの場合にも、DSMIによる時間設定のチェックにて不適合が起こり、結果としてアイテム・レポジトリ内に何もアイテムが表示されないという現象が発生します。その場合は、時間設定をチェックすることで解決出来る事が多いです。