Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
415 lines (324 sloc) 21.6 KB

Installation

  1. Download and unzip 2O3T-Tools.zip
  2. Double-click 2O3T-Tools.sketchplugin to complete the installation.

Update

If you encounter problems such as white screen after updating, you can clear the cache resolution in the settings.

v1.2.0 Added Advanced Features grouping, added Find Replace formula.

Usage

1. Layer Renaming

Execute Plugins > 2O3T Tools > Rename or use the shortcut key command ⌘ + control ⌃ + R. The label formula provided in the rename is used for quick use. The label can also be combined before, you can Reasonable matching of your own needs.

2. How to use labels in layer text renaming (original text) (The following naming methods can be used for multi-layer naming modification)

The following case takes the text 2O3T.cn 二圆三土 as an example.

Layer Name %*% to keep the naming content of the original layer, often used to add a new name to the scene behind the layer, or directly enter the formula %*%;

Example: %*%a >>> 2O3T.cn 二圆三土a

uppercase naming %*u% Keep the naming content of the original layer and convert it to uppercase letters. It is often used to rename scenes with English layers. You can also enter the formula %*u% directly.

Example: %*u% >>> 2O3T.CN 二圆三土

lowercase naming %*l% Keep the original layer's naming content and convert it to lowercase letters. It is often used to rename scenes with English layers. You can also enter the formula %*l% directly.

Example: %*l% >>> 2o3t.cn 二圆三土

initials Uppercase %*uf% Keep the original layer's naming content, and convert its initials to uppercase letters. It is often used to rename scenes with English layers, or you can directly enter the formula %*uf%;

Example: %*uf% >>> 2O3T.cn 二圆三土

hump naming %*c% Keep the naming of the original layer and convert it to the standard hump naming method, or enter the formula %*c% directly

Example: %*c% >>> 2O3Tcn 二圆三土

regular title Name %*t% to retain the naming of the original layer and convert it to a regular title, or enter the formula %*t% directly

Example: %*t% >>> 2O3T.cn 二圆三土

3. How to use the label in the layer property renaming, usually the same as the icon size to the naming.

Get width %w% Get the width of the current element and replace its placeholder with %w%

Get height %h% Get the height of the current element and replace its placeholder with %h%

Example: %*%_%w%x%h% >>> 2O3T.cn 二圆三土_32x32

page name %p% Get the page name of the current element and replace it with %p%

Set: The page name is PageA,

Example: %p%_%*% >>> PageA_2O3T.cn 二圆三土

parent element Name %P% Get the parent element name of the current element and replace it with %P%

Set: The parent element name is ParentB,

Example: %P%_%*% >>> ParentB_2O3T.cn 二圆三土

4. How to use labels in layer sorting and renaming (the following naming methods can be used for multi-layer naming sorting)

lowercase letters Sort %a% Replace '%a%' with lowercase letters a~z

Example: %*%_%a% >>> [ 2O3T.cn 二圆三土_a, 2O3T.cn 二圆三土_b, ... ]

uppercase letters Sort %A% Replace with capital letter A~Z %A%

Example: %*%_%A% >>> [ 2O3T.cn 二圆三土_A, 2O3T.cn 二圆三土_B, ... ]

Digital Ascending %N% is replaced in ascending order by a number starting from 1, N is the number of digits, and multiple Ns are automatically zero-padded in front, such as: %NN% %N%

Example: SORT_%N% >>> [ SORT_1, SORT_2, SORT_3, ... ]

Example: SORT_%NN% >>> [ SORT_01, SORT_02, SORT_03, ... ]

Ascending order %N2% Ascending in ascending order with numbers starting from the specified number (such as 2), N is the number of digits, multiple N will automatically zero in front, such as: %NN2% %N2%

Example: SORT_%N2% >>> [ SORT_2, SORT_3, SORT_4, ... ]

Example: SORT_%NNN15% >>> [ SORT_015, SORT_016, SORT_017, ... ]

Digital descending %n% replaces the number in descending order from the maximum number of selected elements. n is the number of digits. Multiple n will be automatically padded in front, such as: %nn% %n%

Example: SORT_%n% >>> [... SORT_3, SORT_2, SORT_1 ]

Example: SORT_%nn% >>> [... SORT_03, SORT_02, SORT_01 ]

Descending %n2% starts with descending order substitution from the specified number (such as 2), plus the maximum number of selected elements, n is the number of digits, multiple n will automatically zero in front, such as: % Nn2% %n2%

Example: SORT_%n2% >>> [... SORT_4, SORT_3, SORT_2 ]

Example: SORT_%nn2% >>> [... SORT_04, SORT_03, SORT_02 ]

5. How to use the label in the layer text type renaming (the following naming methods can be used to modify the layer naming of the text type)

Assumption: The text font is PingFang SC Regular, the color is #111111 RGB is 17, 17, 17, and the size is: 32

Hexadecimal color %fc% When the current element is text, you can get the hexadecimal color of the text and replace it with %fc%

Example: Hex_#%fc% >>> Hex_#111111

text RGBA Color %fcr% When the current element is text, you can get the R value color in the RGBA of the text and replace it (other G, B, A values ​​can be replaced by g in the formula, g, b , a) %fcr%

Example: RGB_%fcr%_%fcg%_%fcb% >>> RGB_17_17_17

text size %fs% When the current element is text, you can get the text size and replace it with %fs%

Example: Size_%fs%px >>> Size_32px

font name %fn% When the current element is text, you can get the text font name and replace it with %fn%

Example: Font_%fn% >>> Font_PingFang SC Regular

6. Advanced Features

Assumption: The following case is based on the text 2O3T.cn 二圆三土.

specified length Intercept %*s1l3% retains the named content of the original layer of the specified length, s is the starting position (starting at 1), l is the intercept length. You can also enter the formula %*s1l3% directly. For example, modify the middle 3T.c in the title to be modified to yy7t. We can change the formula to %*s1l2%yy7t%*s7l6%;

Example: %*s1l2%yy7t%*s7l6% >>> 2Oyy7tn 二圆三土

Simple formula method, if the modified content is only the middle part of the text, as long as the output to the replacement text part, the latter formula does not need complete output, the formula will automatically retain the following content

Example: %*s9l3%yy7tn >>> 二圆三土yy7tn

Intercept %*s1e6% Keep the naming content of the original layer at the specified position, s is the starting position (starting at 1), e is the cutoff position. You can also directly enter the formula %*s1e6% to modify In the middle of the title, 3T.c is modified to yy7t, we can change the formula to %*s1e2%yy7t%*s6e12%;

Example: %*s1e2%yy7t%*s6e12% >>> 2Oyy7tn 二圆三土

Simple formula method, if the modified content is only the middle part of the text, as long as the output to the replacement text part, the latter formula does not need complete output, the formula will automatically retain the following content

Example: %*s8e10%yy7tn >>> 二圆yy7tn

Find Replace %*fO$rT% to specify a section of the original layer's naming to be replaced, f is the specified content in the original text, $r is the content that needs to be replaced (can be empty).

Example: Find_Replace_%*f2O3T$rABC% >>> Find_Replace_ABC.cn