substitute
🔗NAME
substitute
🔗SYNOPSIS
perform all the variable substitution steps with one function call
🔗USAGE
local ds = require "lib/dtutils.string"
local result = ds.substitute(image, sequence, variable_string, [username], [pic_folder], [home], [desktop])
- image - dt_lua_image_t - the image being processed
- sequence - integer - the sequence number of the image being processed (exported)
- variable_string - string - the substitution variable string
- [username] - string - optional - user name. Will be determined if not supplied
- [pic_folder] - string - optional - pictures folder name. Will be determined if not supplied
- [home] - string - optional - home directory. Will be determined if not supplied
- [desktop] - string - optional - desktop directory. Will be determined if not supplied
🔗DESCRIPTION
substitute initializes the substitution list by calling clear_substitute_list, then builds the substitutions by calling build_substitute_list and finally does the substitution by calling substitute_list, then returns the result string.
🔗RETURN VALUE
result - string - the input string with values substituted for the variables