How to set\get preference-set

Helo everybody.
Is there any way how to save ‘preference-set’ to prefs.xml with script ?

<preference-set id="foo-set">

And how to set\get values in this preference set ?

It’s easier if you use the simple-storage SDK to store persistent data in Komodo:

var ss= require("ko/simple-storage").get("myStorage").storage; = "bar"; = {"vege burger":"good", "pizza":"great"};
// some other piece of code that needs this info

To use prefs:

var prefSet = Components.classes[';1'].createInstance();
var globalPrefs = require("ko/prefs");
globalPrefs.setPref("foo-set", prefSet);
//Then you can add stuff to that a prefSet
  • Carey

Thank You very much Careyh.

It works nice. :+1: