Bongo sagte in Javascript-Adapter Script-Mirror:
Zum Test habe ich eine kleine Blockly Datei gemacht. Das steht dann im Filesystem mit der Dateiendung .js:
Wenn ich das importiere in ein neues, leeres Blockly sehe ich nichts.
Bei js2fs hat es zu einem Blockly eine .js und eine .blockly gegeben.
hier mal ein kleines Skript, welche eine solche Datei in ein XML zum Import umwandelt. Zeile 2+3 anpassen!
const fs = require('fs'); const fn = '/opt/iobroker/restore/Test.js' const fnOut = '/opt/iobroker/restore/Test.xml' getData(); function getData(){ try { var data = fs.readFileSync(fn, 'utf8') const pos = data.lastIndexOf('\n'); if (pos !== -1) { data = data.substring(pos + 3); if(data.indexOf('JTNDeG1sJTIweG1') !== -1) { data = decodeURIComponent(Buffer.from(data, 'base64').toString('utf8')); fs.writeFile(fnOut, data, err => { if(err) { return console.log(err); } log('Done!'); }); } } }catch(e){ return log(e); } }