Reading the IniFile
Moderators: jiri, drakinite, Addon Administrators
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Reading the IniFile
The com-object SDB.IniFile isn't available in the Beta MM5. Will this be included in the final Version of MM5? If not, how can i read from Mediamonkey.ini?
Greetings
Sven
Greetings
Sven
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Re: Reading the IniFile
Could you clarify the exact user-case, please? We don't plan to port all of the COM, but will try to help with everything that makes sense.
Thanks,
Jiri
Thanks,
Jiri
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Re: Reading the IniFile
Hi Jiri,
i need the following settings from the ini-file:
"PreviewSettings" -> "DefaultCoverStorage"
"AAMasks" -> "Mask1"
"CustomFields" -> "Fld1Name"
"CustomFields" -> "Fld2Name"
"CustomFields" -> "Fld3Name"
"CustomFields" -> "Fld4Name"
"CustomFields" -> "Fld5Name"
"Appearance" -> "MultiStringSeparator"
It would be great if i can read this settings.
Thank you!
Greetings,
Sven
i need the following settings from the ini-file:
"PreviewSettings" -> "DefaultCoverStorage"
"AAMasks" -> "Mask1"
"CustomFields" -> "Fld1Name"
"CustomFields" -> "Fld2Name"
"CustomFields" -> "Fld3Name"
"CustomFields" -> "Fld4Name"
"CustomFields" -> "Fld5Name"
"Appearance" -> "MultiStringSeparator"
It would be great if i can read this settings.
Thank you!
Greetings,
Sven
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Re: Reading the IniFile
Are you referring to tools that can devs use in order to read/write MediaMonkey.INI?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying



How to attach PICTURE/SCREENSHOTS to forum posts
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying



How to attach PICTURE/SCREENSHOTS to forum posts
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Re: Reading the IniFile
I implemented my own read/write function in the script to store the user settings.
So it would be helpful for me if i can use a COM which give me the path to the mediamonkey.ini (like SDB.TemporaryFolder)
With the path i can use my func to read the settings i need.
So it would be helpful for me if i can use a COM which give me the path to the mediamonkey.ini (like SDB.TemporaryFolder)
With the path i can use my func to read the settings i need.
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Re: Reading the IniFile
As a workaround for now ...
We have API for accessing INI from JS:
In COM model we have SDB.runJSCode method to run JS code and return values you're required.
We have API for accessing INI from JS:
Code: Select all
var sett = JSON.parse(app.settings.getJSON(''));
var Custom1 = sett.CustomFields.Fld1Name;
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Re: Reading the IniFile
Thank you for the workaround!
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Re: Reading the IniFile
How did i get the var Custom1 back to the COM model?PetrCBR wrote:As a workaround for now ...
We have API for accessing INI from JS:
In COM model we have SDB.runJSCode method to run JS code and return values you're required.Code: Select all
var sett = JSON.parse(app.settings.getJSON('')); var Custom1 = sett.CustomFields.Fld1Name;
I tested it with this vbscript. The test with window.alert show me the name of the Customfield1, so it works, but i need the name in the ret variable.
Code: Select all
Set SDB = CreateObject("SongsDB5.SDBApplication")
Code = "var sett = JSON.parse(app.settings.getJSON(''));" & vbCrLf
Code = Code & "var Custom1 = sett.CustomFields.Fld1Name;" & vbCrLf
Code = Code & "window.alert(Custom1);"
ret = SDB.runJSCode(Code, True)
MsgBox(ret)
Thanks for your help.
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Re: Reading the IniFile
Simply use return
for example:
for example:
Code: Select all
Set SDB = CreateObject("SongsDB5.SDBApplication")
Code = "(function () { var sett = JSON.parse(app.settings.getJSON(''));" & vbCrLf
Code = Code & "var Custom1 = sett.CustomFields.Fld1Name;" & vbCrLf
Code = Code & "return Custom1; })()"
ret = SDB.runJSCode(Code, True)
MsgBox(ret)
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Re: Reading the IniFile
Happy new year to you and the MM-Team.
Sorry, but it doesn't work for all settings:
I try to fetch these 3 settings
Trying to fetch the setting: PreviewSettings.DefaultCoverStorage returns nothing
Trying to fetch the setting: AAMasks.Mask1 returns an Application Error
Trying to fetch the setting: MultiStringSeparator return the correct value
Sorry, but it doesn't work for all settings:
I try to fetch these 3 settings
Code: Select all
Set SDB = CreateObject("SongsDB5.SDBApplication")
SDB.ShutdownAfterDisconnect = False
Code = "(function () { var sett = JSON.parse(app.settings.getJSON(''));" & vbCrLf
'Code = Code & "var ret = sett.PreviewSettings.DefaultCoverStorage;" & vbCrLf
'Code = Code & "var ret = sett.Appearance.MultiStringSeparator;" & vbCrLf
Code = Code & "var ret = sett.AAMasks.Mask1;" & vbCrLf
Code = Code & "return ret; })()"
ret = SDB.runJSCode(Code, True)
MsgBox(ret)
Trying to fetch the setting: AAMasks.Mask1 returns an Application Error
Trying to fetch the setting: MultiStringSeparator return the correct value
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Re: Reading the IniFile
Best would be to add
var sett = JSON.parse(app.settings.getJSON(''));
into JS script and using a devtools check what values you can access.
var sett = JSON.parse(app.settings.getJSON(''));
into JS script and using a devtools check what values you can access.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
-
- Posts: 944
- Joined: Sat Jan 26, 2013 6:00 am
- Location: Friedberg / Hessen / Germany
- Contact:
Re: Reading the IniFile
I don't know, what i have to do. Could you please this more explain?PetrCBR wrote:Best would be to add
var sett = JSON.parse(app.settings.getJSON(''));
into JS script and using a devtools check what values you can access.
Metal up your ass !
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
-----------------------------------------------
I added my first 2 videos on youtube. The language is german.
Discogs Autorisierung: https://www.youtube.com/watch?v=oryxKKtnEnc
Discogs Tagger Bedienung: https://www.youtube.com/watch?v=85Wk-5rd-W0
Re: Reading the IniFile
I've added complete list of settings into wiki
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643