I’m trying to recreate a tool I had that would apply a theme as a song is loaded (theme named after the song), i lost the tool when migrating from linux to windows.
I’m ok with most of it, but the main function renoise.app():load_theme() is failing to apply the theme, but gives no error:
renoise.app():load_theme(‘full path to theme’)
renoise.app():load_theme(‘theme name only with extension’)
renoise.app():load_theme(‘theme name without extension’)
I can make it error by using an undeclared variable, so i know the function is working:
*** TestPad.lua:15: variable ‘dfghjkl’ is not declared
Where am I going wrong? Any help, or even ‘go read this’ much appreciated.
Probably the error is in not correctly declaring the path to the theme file. The path (a string) must be complete, that is, the exact folder where the file is, including the exact file name and its extension name at the end.
--os.currentdir() --> the folder of your tool
local path=("%stheme/"):format(os.currentdir()) --folder named "theme" inside your tool folder
if (path) then --check if path exist
local filename=path.."name.extension" --you will probably have to capture this name beforehand.
if (filename) then --check if filename exist inside your "theme" folder
print(This filename not exist!)
print(This path not exist!)
This function can be used for an already created folder with your already created theme files.
You can build another function that allows you to select a specific folder and a specific theme file, fetch that file path with a local one, and then call the load_theme() function.
Many thanks, I’m still hitting the same problem, even when this script generates the full filename, it still stalls at renoise.app():load_theme(filename) without error.
Even the following single line script fails to apply the theme:
\ is used to backslash special characters in Lua. use
\\ instead or
/, which works in Windows as well.
See Lua - Strings for more info on this.
that was it! many thanks.
here’s the script for anyone else whose brain sees music in colours
local skin =path .. renoise.song().name .. '.xrnc'
if not renoise.tool().app_new_document_observable:has_notifier(startup_notifier)
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.