This is #4 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シリーズのパート4です。本Tipsの使用は日本語版のAdobe InDesign使用を前提としています。
また、宛名の縦組みに関する基本方法は過去の投稿「宛名の縦書き」を参照して下さい。
How to lay out the recipient name looking nicely when it should be joint signature.
宛名の連名表記を見栄え良く表示する方法
This tips if for user who have below request.
このTipsは以下の様な要望をお持ちのユーザー向けです。
- Lay out multiple recipient name looks nicely, especially when the database contain not only full name, but also only first name as second name that should be displayed.
- 氏名・名のみなどのレコードが混在するデータベース使用時に、宛名の連名表記を見栄え良く表示したい
Preview of the problematic text display :
問題点の画像プレビュー:
Preview 1 : Full Name for main recipient and Full Name for second recipient.
As you can see, it’s no problem at all. Both text fit into text frame, and was adjusted accordingly by Adobe InDesign text frame setting.
プレビュー1:メインの宛名が氏名、連名も氏名の場合
ご覧のとおり、何の問題もありません。どちらの宛名もAdobe InDesignのテキストフレームの設定に従って表示されています。
Preview 2 : Full Name for main recipient and only First Name for second recipient.
As you can see, it looks not nice, especially for second recipient’s name. It because this text frame have been set with “Full Justification” in vertically.
プレビュー2:メインの宛名が氏名で、連名が名前のみの場合
御覧いただける通り、連名用の名前が両端揃えにて表示されているので、見栄えが良くありません。
Preview 3 : Full Name for main recipient and only First Name for second recipient. (nogtips version)
This looks much better than above one. So we added additional space key in front of second recipient’s first name. So it start to describe her name almost same position of mail recipient’s first name.
プレビュー3:メインの宛名が氏名、連名も氏名の場合(nogtips使用バージョン)
御覧いただける通り、連名の名前がメインの宛名の苗字部分より下がって表示されているので、より見栄えが良くなっています。
What you can achieve with this tip?
このTipsで何が出来るのか?
This tips make you able to display a join signature with nice-looking. Especially, when your database contain second name that should be a part of the joint signature as recipient name even those name is full-name, or just only first name.(It because if you assign the second name to text frame, the looking of those text frame is not good when it only have first name, because it will start to describing from the top, although other name start from Last name + First name)
本Tipsを使用すると、宛名の連名表記をするにあたり、データベースに二番目の方の名前が「氏名(フルネーム)」または「名前のみ」といった値が混在する場合に、単一のテキストフレームへのテキストの流しこみをす事による見栄えの崩れを防げ、連名であっても見栄え良く表記する事が可能になります。
Preview :
プレビュー:
With this tips, even your database contain both type of name as second recipient name(Full name or only First name), it can display the recipient name with nice-looking.
このTipsを使用すると、例えデータベースのレコードが連名用の項目に「氏名」または「名前のみ」といった値が混在している場合でも、一括処理が可能になり、また見栄えを良くすることが可能になります。
Setup
設定方法
Please refer to former post of this series regarding basic setting.
縦組みのテキストフレームに関する基本的設定方法は過去の投稿を参照してください。
- Create variables at outside of page layout. Those variables will be used for script.
ページのレイアウト範囲外にスクリプトで使用するためのバリアブルを作成します。
Actual database looks like below.
実際に使用しているデータベースは以下の通りです。
- Create text frame for vertically scripting.
宛名用に縦組みのテキストフレームを作成します。You should check maximum characters that can be displayed vertically by this text frame. I checked it by using “circle” instead of typing character. And this text frame can display 10 characters as vertical maximum number.(It’s just for checking, so you can remove those circles after you check it)With this text frame, you need to set “Full Justification” as type setting.
宛名用のテキストフレームを作成する際は、最大何文字まで縦組みにて表記出来るのかをチェックします。今回は「○」を使用して文字数のチェックをしています。このテキストフレームには縦組みにて最大10文字表記することが可能です。
- Register all frames in DSM-Bridge as variable element.
全てのバリアブル項目をDSM-Bridgeに登録する。 - Setup for each variables :
All variable should have assignment like below.バリアブル項目への割り当て:
以下の様に割り当てを行います。[[Name1]]
Because both of them will be used as recipient name, so I addes “様” as title oh honor in the end of their name.これらのバリアブル項目は実際に宛名用のテキストフレームにて使用する値となるので、宛名用に最後に「様」を追加します。
- Edit VBScript
Let’s edit vbscript. I made script that named as “Vertical Script3”. Here is the entire of script code.VBスクリプトの編集:
それではVBスクリプトを編集します。今回は以下のようにしました。
function JointSignatureScript() Dim firstName, secondName, secondWithSal, spacekey, Cnt, work, work2, aspace, secondFullText firstName = RS("氏名") secondWithSal = RS("連名用") spacekey=" " Cnt=Len(firstName) work=InStr(firstName, spacekey) work2 = InStr(secondName, spacekey) If work2 <> 0 Then Var.PutS "JSign01", secondWithSal JointSignatureScript = secontWithSal Else aspace = String(work, spacekey) secondFullText = aspace & secondWithSal Var.PutS "JSign01", secondFullText JointSignatureScript = secondFullText End If End function
- Edit variable property :
The last thing and most important is to specify the order of variable process. If you don’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.
各バリアブルの値を受け取る順序設定は以下の通りです。“Full_Name” = 1
“Name1” = 1
“Script” = 2
“JSgin01” = 3