Preferences - how to read user-set paths to variables for tool?

Hi, how would I go about configuring a tool so that the user can define, say, a savepath for a function?

I’m working on modifying Paketti so that it is a bit more friendly for usage with macOS and Smart Folders / Automator-based Folder Actions. That means writing samples to a specific folder.

Since nobody else has /Users/esaruoho/Music/samples/LiveSmartFolder - I’m wondering how change that into a variable that a non-scripter-user could change easily, so that it’s saved into a preferences.xml or something?

Display a window that allows editing of user variables and save the results using renoise.Document

I did this with my tool LoopComposer

I also use this in my Alternator tool so that the last-used values are reloaded.

Look at the code in the GUI.lua files of those tools for loading and saving values.