Accessing Addon version

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Accessing Addon version

Re: Accessing Addon version

by gexptwo » Mon Sep 19, 2022 11:05 am

json approach works, thanks!

Re: Accessing Addon version

by drakinite » Sun Sep 18, 2022 4:01 pm

Unfortunately (as far as I can see) there's no simple way to retrieve the addon info from outside the config window (you'd have to do app.getAddonList() and do something like list.filterByPrefix() to get the right addon). But if you like, you could try loading the info.json file with the loadFile command.

Example with the Refresh Skin shortcut:

Code: Select all

let myInfoJson;
try {
  myInfoJson = JSON.parse(loadFile('file:///refreshSkinShortcut/info.json'));
}
catch (err) { }

Accessing Addon version

by gexptwo » Sun Sep 18, 2022 2:55 pm

I'm writing a display Addon. Following the Getting Started page, I see 'version' specified in info.json. I would like my display addon to show the version, I'm trying not to define the version in multiple places.
My actions_add.js has

Code: Select all

var dlg = uitools.openDialog('display', {
Is there a way for my display.js to access the 'version'? I've tried

Code: Select all

function init(params) {
    var try1 = this.version;
    var try2 = params.addon.version;
    var try3 = this.addon.version;
}
but not found. I saw the config.js addon parameter should have access but I think that would require opening the addon config first.

Top