Script functions by category

Script functions by category

These functions are built into the program, other functions can be defined using the scripting language.

Type conversion
to_string Convert any value to a string
to_int Convert any value to a number
to_real Convert any value to a real number
to_number Convert any value to a number
to_boolean Convert any value to a boolean
to_color Convert any value to a color
to_image Convert any value to an image
to_date Convert any value to a date
Numbers
abs Absolute value
random_int Generate a random number.
random_real Generate a random real number.
random_boolean Generate a random boolean.
Text manipulation
to_upper Convert a string to upper case, "aBc" -> "ABC".
to_lower Convert a string to lower case, "aBc" -> "abc".
to_title Convert a string to title case, "aBc" -> "Abc".
reverse Reverse a string, "aBc" -> "cBa".
trim Remove leading and trailing whitespace from a string, " abc " -> "abc".
substring Extract a part of a string.
replace Replace text matching a regular expression.
filter_text Keep only the text matching a regular expression.
break_text Break text into parts each matching a regular expression.
split_text Split text into parts separated by a regular expression.
sort_text Sort the letters in a string using a custom order.
contains Does a string contain another one?
match Does a string match a regular expression?
regex_escape Escape a string for use in a regular expression.
curly_quotes Make quotes curly.
check_spelling Check text for spelling errors.
Tags
tag_contents Change the contents of a specific tag.
remove_tag Remove a tag, keep the contents.
remove_tags Remove all tags from tagged text.
Lists
position Find the position of an element in a list.
length Return the number of items in a list.
number_of_items Return the number of items in a list.
sort_list Sort a list.
filter_list Filter a list, keeping only elements that match a predicate.
random_shuffle Randomly shuffle a list.
random_select Pick a random element from a list.
random_select_many Pick multiple random elements from a list.
Keywords
expand_keywords Expand the keywords in a piece of text.
keyword_usage What keywords are used on a card, and how often are they used?
English language
english_number Convert a number to text ("one", "two", etc.)
english_number_a Convert a number to text ("a", "two", etc.)
english_number_multiple Convert a number to text ("", "two", etc.)
english_number_ordinal Convert a number to text ("first", "second", etc.)
english_plural Find the plural of a word, "card" -> "cards".
english_singular Find the singular of a word, "cards" -> "card".
process_english_hints Process the hints left by english_ functions in a keyword's reminder text.
Fields and values
forward_editor Use one field to edit another.
combined_editor Use one field to edit multiple others.
primary_choice Return the top level choice chosen from a choice field.
chosen Is the given choice selected in a multiple choice value?
count_chosen Count then number of choices selected in a multiple choice value.
require_choice Require that at least one of the given choices is selected.
exclusive_choice Require that at most one of the given choices is selected.
require_exclusive_choice Require that exactly one of the given choices is selected.
remove_choice Remove the given choices from a multiple choice value.
Images
linear_blend Blend two images together using a linear gradient.
masked_blend Blend two images together using a third mask image.
combine_blend Blend two images together using a given combining mode.
set_mask Set the transparancy mask of an image.
set_alpha Change the transparency of an image.
set_combine Change how the image should be combined with the background.
saturate Saturate/desaturate an image.
invert_image Invert the colors of an image.
recolor_image Change the colors of an image to match the font color.
enlarge Enlarge an image by putting a border around it.
crop Crop an image, giving only a small subset of it.
flip_horizontal Flip an image horizontally.
flip_vertical Flip an image vertically.
rotate Rotate an image.
drop_shadow Add a drop shadow to an image.
symbol_variation Render a variation of a symbol.
built_in_image Return an image built into the program.
Cards
new_card Construct a new card object.
HTML export
to_html Convert tagged text to html.
symbols_to_html Convert text to html using a symbol font.
to_text Remove all tags from tagged text, and convert it to a string.
copy_file Copy a file from the export template to the output directory.
write_text_file Write a text file to the output directory.
write_image_file Write an image file to the output directory.
write_set_file Write a MSE set file to the output directory.
Other functions
trace Output a message for debugging purposes.
assert Check a condition for debugging purposes.