搜索並替換對話方塊 (資料來源轉換)

搜索並替換」對話方塊可針對搜尋和取代轉換建立、修改和測試動作。您可以使用下列其中一種方法來開啟此對話方塊:

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.可使用下列選項:

測試:開啟「測試動作清單」對話方塊,您可以使用此對話方塊測試動作清單,並確認動作是否按預期執行。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.動作會依照在「動作」清單中出現的順序執行。

關閉Using the Search and Replace Transform with Data-Sourced Colors

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.

為此,請依照以下步驟進行:

  1. Connect your document to a database that contains a MemberLevel field that includes the following values:Monthly, Annual, and Unlimited.

  2. Add a rectangular shape object to the template for the stripe.

  3. 按兩下矩形以開啟「矩形屬性」對話方塊。

  4. Configure the rectangle's fill properties to use color that is sourced by using the search and replace transform.為此,請依照以下步驟進行:

    1. In the Fill Properties area, click the Color option to open the Color Picker.

    2. Click to expand the Color Picker if it is not already expanded.

    3. On the Standard or Custom tab, click Set via data source.

    4. 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.

    5. 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.按一下「下一步」。

    6. 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.

    7. In the Data Sourced Color dialog, click the Transforms tab.

    8. Click next to the Search and replace field to open the Search and Replace dialog.

    9. On the toolbar at the bottom of the Actions list, click .

    10. 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.

    11. Repeat steps i and j for the other values in the MemberLevel database field.

    12. Click OK to close the Search and Replace dialog.

  5. 按一下「確定」以關閉「資料來源色彩」對話方塊。

  6. As needed, repeat this procedure for the line properties of the rectangle.Otherwise, click Close to close the Box Properties dialog.

關閉Predefined Colors

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   #000080
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

關閉Using the Search and Replace Transform to Add Soft Hyphens to Text

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.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.

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.

為此,請依照以下步驟進行:

  1. Add a normal wrapped text object to your BarTender template, and then enter the text that contains the backslash and hyphen combinations.

  2. 按兩下文字物件以開啟「文字內容」對話方塊。

  3. On the Transforms tab, click  to the right of the Search and replace field.

  4. On the actions toolbar, click to create a new action.

  5. 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.

  6. Click OK to close the Search and Replace dialog.

  7. 按一下「關閉」以關閉「文字內容」對話方塊。

On the BarTender template, you can resize the text object to observe how the hyphenation changes dynamically.

相關主題