検索と置換 |
[検索と置換] ダイアログでは、[検索と置換] 変換の操作を作成、変更、およびテストすることができます。このダイアログを開くには、次のいずれかの方法を使用します。
[データソース] プロパティページの [変換] タブで [検索と置換] の横にある をクリックします。
[ヒューマンリーダブル] プロパティページの [検索と置換] オプションの横にある をクリックします。
Depending on what kind of transform you want to perform, the action can consist of the text to be searched for; instructions to insert, replace, or delete that text; and the search method to be used.使用するコードページを指定することもできます。The actions are performed in the order in which they appear in the Actions list, and each action makes a complete pass through the trigger file before the next action is started.
You can transfer the list of actions between installed instances of BarTender by using the Import and Export options.
次のオプションを使用できます。
アクション:Lists the search and replace actions that you have configured.The following options are available in the toolbar at the bottom of the list:
Adds a new action to the list.
選択した実行操作を一覧から削除します。
選択した操作をリストから削除し、操作のコピーをクリップボードに保存します。
選択した操作をクリップボードにコピーします。
クリップボードにある操作のコピーを実行リストに貼り付けます。
選択した実行を一覧内で一行上に移動します。
選択した実行を一覧内で一行下に移動します。
|
|
[実行] リストを右クリックして、これらのコマンドにアクセスすることもできます。 |
インポート:Opens the Import Action List dialog so that you can load an actions list that was previously saved as an XML file in another installed instance of BarTender.
エクスポート:Opens the Export Action List dialog so that you can save the current actions list in an XML file.
Action Options:Specifies the configuration for the action that is selected in the Actions list.次のオプションを使用できます。
説明:Specifies a descriptive name for the action.
実行:Specifies what kind of transform action is to be performed.
検索文字列:選択したデータソースで検索するテキストを指定します。To enter non-typable characters, such as carriage returns, into the search field, click
, and then select the character that you want.
構文:Specifies the syntax that the search operation uses for the text in the Search Text field.Available options include literal, regular expression, and wildcard.
最初の生成のみ:検索テキストの最初の発生に対してのみ操作が実行されます。
置換文字列:選択したデータソースで検索テキストを置き換えるテキストを指定します。To enter non-typable characters into the search field, click
, and then select the character that you want.Available when Action includes a "replace" or "delete" operation.
挿入:選択したデータソースで検索テキストの前または後に挿入するテキストを指定します。To enter non-typable characters into the search field, click
, and then select the character that you want.Available when Action includes an "insert" operation.
テスト:[実行リストのテスト] ダイアログが開き、操作のリストをテストし、操作が予期したとおりに動作することを確認できます。In this dialog, you can specify the location of a sample file that contains the data in the data source and export the file to a destination file.操作は、[実行] リストに表示された順序で実行されます。
You can use the search and replace transform to associate data-sourced colors with objects on your template.If the database that your document is connected to does not contain color information, you can use the search and replace transform to map each value in a database field to a unique color.The transform searches for the value of the field that you specify and replaces it with the color that you specify.
次の例を考えてみましょう。
Your company produces membership cards for a local gym.Members can have monthly, annual, or unlimited membership levels, and you want a color-coded stripe that corresponds to each level to appear on the cards.You have connected to a database that includes a "MemberLevel" field, and you want to associate this field with a different color for each membership level.In this case, you can use the search and replace transform to search for each membership level in the database and then map a different color to each level.
これを行うには、次の手順を実行します。
Connect your document to a database that contains a MemberLevel field that includes the following values:Monthly, Annual, and Unlimited.
Add a rectangular shape object to the template for the stripe.
四角形をダブルクリックして、[ボックスのプロパティ] ダイアログを開きます。
Configure the rectangle's fill properties to use color that is sourced by using the search and replace transform.これを行うには、次の手順を実行します。
In the Fill Properties area, click the Color
option to open the Color Picker.
Click to expand the Color Picker if it is not already expanded.
On the Standard or Custom tab, click Set via data source.
In the Data Sourced Color dialog, make sure that Get color from data source is selected, and then click Data Source in the left navigation pane.
On the Data Source tab, click
for the Type field, and then use the Change Data Source Type wizard to change the data source type to Database Field.[Next(次へ)] をクリックします。
On the Database Field page of the Change Data Source Type wizard, select the MemberLevel field in the Field name list, and then click Finish.
In the Data Sourced Color dialog, click the Transforms tab.
Click
next to the Search and replace field to open the Search and Replace dialog.
On the toolbar at the bottom of the Actions list, click
.
In the Actions Options area, configure the following properties:
In the Description field, add a descriptive name for the action.
In the Action list, make sure that Search and Replace is selected.
In the Search for field, enter the value of the MemberLevel database field that you want to search for.For example, enter "Monthly".Make sure that the term that you enter is an exact match for the term in the database that you want to search for.
In the Replace with field, enter the name or hexadecimal value of the color that you want to use for the Monthly membership level.(Supported colors are listed in the "Predefined Colors" section that follows.) If you use the hexadecimal value, do not include the number sign (#).
For Pantone colors, use either the "friendly" name (such as "Electric Purple") or the technical name (such as "PANTONE 18-3640 TN").You can view a list of these colors by clicking the PANTONE tab of the Color Picker.
Repeat steps i and j for the other values in the MemberLevel database field.
Click OK to close the Search and Replace dialog.
[OK] をクリックして [データソースからの色] ダイアログを閉じます。
As needed, repeat this procedure for the line properties of the rectangle.Otherwise, click Close to close the Box Properties dialog.
The following table lists supported predefined colors and their hexadecimal values.To view a list of supported Pantone colors, click the PANTONE tab in the Color Picker.
|
色の名前 |
HEX 値 |
色の名前 |
HEX 値 |
|||
|---|---|---|---|---|---|---|
| AliceBlue | #F0F8FF | LightSalmon | #FFA07A | |||
| AntiqueWhite | #FAEBD7 | LightSeaGreen | #20B2AA | |||
| Aqua | #00FFFF | LightSkyBlue | #87CEFA | |||
| Aquamarine | #7FFFD4 | LightSlateGray | #778899 | |||
| Azure | #F0FFFF | LightSteelBlue | #B0C4DE | |||
| Beige | #F5F5DC | LightYellow | #FFFFE0 | |||
| Bisque | #FFE4C4 | Lime | #00FF00 | |||
| Black | #000000 | LimeGreen | #32CD32 | |||
| BlanchedAlmond | #FFEBCD | Linen | #FAF0E6 | |||
| Blue | #0000FF | Magenta | #FF00FF | |||
| BlueViolet | #8A2BE2 | Maroon | #800000 | |||
| Brown | #A52A2A | MediumAquamarine | #66CDAA | |||
| BurlyWood | #DEB887 | MediumBlue | #0000CD | |||
| CadetBlue | #5F9EA0 | MediumOrchid | #BA55D3 | |||
| Chartreuse | #7FFF00 | MediumPurple | #9370DB | |||
| Chocolate | #D2691E | MediumSeaGreen | #3CB371 | |||
| Coral | #FF7F50 | MediumSlateBlue | #7B68EE | |||
| CornflowerBlue | #6495ED | MediumSpringGreen | #00FA9A | |||
| Cornsilk | #FFF8DC | MediumTurquoise | #48D1CC | |||
| Crimson | #DC143C | MediumVioletRed | #C71585 | |||
| Cyan | #00FFFF | MidnightBlue | #191970 | |||
| DarkBlue | #00008B | MintCream | #F5FFFA | |||
| DarkCyan | #008B8B | MistyRose | #FFE4E1 | |||
| DarkGoldenrod | #B8860B | Moccasin | #FFE4B5 | |||
| DarkGray | #A9A9A9 | NavajoWhite | #FFDEAD | |||
| DarkGreen | #006400 | Navy | #191970 | |||
| DarkKhaki | #BDB76B | OldLace | #FDF5E6 | |||
| DarkMagenta | #8B008B | Olive | #808000 | |||
| DarkOliveGreen | #556B2F | OliveDrab | #6B8E23 | |||
| DarkOrange | #FF8C00 | Orange | #FFA500 | |||
| DarkOrchid | #9932CC | OrangeRed | #FF4500 | |||
| DarkRed | #8B0000 | Orchid | #DA70D6 | |||
| DarkSalmon | #E9967A | PaleGoldenrod | #EEE8AA | |||
| DarkSeaGreen | #8FBC8F | PaleGreen | #98FB98 | |||
| DarkSlateBlue | #483D8B | PaleTurquoise | #AFEEEE | |||
| DarkSlateGray | #2F4F4F | PaleVioletRed | #DB7093 | |||
| DarkTurquoise | #00CED1 | PapayaWhip | #FFEFD5 | |||
| DarkViolet | #9400D3 | PeachPuff | #FFDAB9 | |||
| DeepPink | #FF1493 | Peru | #CD853F | |||
| DeepSkyBlue | #00BFFF | Pink | #FFC0CB | |||
| DimGray | #696969 | Plum | #DDA0DD | |||
| DodgerBlue | #1E90FF | PowderBlue | #B0E0E6 | |||
| FireBrick | #B22222 | Purple | #800080 | |||
| FloralWhite | #FFFAF0 | Red | #FF0000 | |||
| ForestGreen | #228B22 | RosyBrown | #BC8F8F | |||
| Fuchsia | #FF00FF | RoyalBlue | #4169E1 | |||
| Gainsboro | #DCDCDC | SaddleBrown | #8B4513 | |||
| GhostWhite | #F8F8FF | Salmon | #FA8072 | |||
| Gold | #FFD700 | SandyBrown | #F4A460 | |||
| Goldenrod | #DAA520 | SeaGreen | #2E8B57 | |||
| Gray | #808080 | Seashell | #FFF5EE | |||
| Green | #008000 | Sienna | #A0522D | |||
| GreenYellow | #ADFF2F | Silver | #C0C0C0 | |||
| Honeydew | #F0FFF0 | SkyBlue | #87CEEB | |||
| HotPink | #FF69B4 | SlateBlue | #6A5ACD | |||
| IndianRed | #CD5C5C | SlateGray | #708090 | |||
| Indigo | #4B0082 | Snow | #FFFAFA | |||
| Ivory | #FFFFF0 | SpringGreen | #00FF7F | |||
| Khaki | #F0E68C | SteelBlue | #4682B4 | |||
| Lavender | #E6E6FA | Tan | #D2B48C | |||
| LavenderBlush | #FFF0F5 | Teal | #008080 | |||
| LawnGreen | #7CFC00 | Thistle | #D8BFD8 | |||
| LemonChiffon | #FFFACD | Tomato | #FF6347 | |||
| LightBlue | #ADD8E6 | Turquoise | #40E0D0 | |||
| LightCoral | #F08080 | Violet | #EE82EE | |||
| LightCyan | #E0FFFF | Wheat | #F5DEB3 | |||
| LightGoldenrodYellow | #FAFAD2 | White | #FFFFFF | |||
| LightGray | #D3D3D3 | WhiteSmoke | #F5F5F5 | |||
| LightGreen | #90EE90 | Yellow | #FFFF00 | |||
| LightPink | #FFB6C1 | YellowGreen | #9ACD32 |
You can use the search and replace transform to add soft hyphens to your text.Soft hyphens are invisible formatting characters that you can use to dynamically break words at any defined hyphenation point.
次の例を考えてみましょう。
Your company produces labels that use one of several different languages to convey the same information.You define the hyphens for the text that is to be inserted in the text object so that the hyphenation will be correct for each language as it is printed, no matter the size or shape of the text object.
For example, for the German label, you want the following text to appear:
Ab dem 24.August 2023 muss vor der industriellen oder gewerblichen Verwendung eine angemessene Schulung erfolgen.
You use a backslash (\) and hyphen (-) combination to define hyphenation points for this text as follows:
Ab dem 24.Au\-gust 2023 muss vor der in\-dus\-tri\-ellen oder ge\-werb\-lich\-en Ver-wen\-dung ei\-ne an\-ge\-mes\-sene Schu\-lung er\-fol\-gen.
Then, you want to replace these hyphenation placeholders with a Unicode soft hyphen.When you do this, the printed label shows only those hyphens that are necessary for the size and shape of the printed text object and hides the others.
これを行うには、次の手順を実行します。
Add a normal wrapped text object to your BarTender template, and then enter the text that contains the backslash and hyphen combinations.
テキストオブジェクトをダブルクリックして、[テキストのプロパティ] ダイアログを開きます。
On the Transforms tab, click
to the right of the Search and replace field.
On the actions toolbar, click
to create a new action.
In the Action Options area, configure the settings as follows:
In the Description field, enter an optional description of the action.
In the Action list, select Search and Replace.
In the Search for box, enter a backslash and hyphen combination (\-).
In the Syntax list, select Literal.
Click inside the Replace with box, and then press ALT+0173.Notice that no character appears in the box, but the text in the text object adjusts to replace the backslash and hyphen combinations with soft hyphens.
Click OK to close the Search and Replace dialog.
[閉じる] をクリックして、[テキストのプロパティ] ダイアログを閉じます。
On the BarTender template, you can resize the text object to observe how the hyphenation changes dynamically.
関連トピック