It is currently May 3rd, 2024, 5:59 pm

Using Default Editor in a Bang

Get help with installing and using Rainmeter.
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Using Default Editor in a Bang

Post by prince1142003 »

Is there a way to retrieve the default editor in Rainmeter.ini and use it in a bang?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Default Editor in a Bang

Post by jsmorley »

Not easily*. There is no variable that obtains the "ConfigEditor" item from Rainmeter.ini. The is mostly because 99.9% of folks never set this value, and allow the application associated with ".ini" in Windows control what opens skin files. For many this is just Windows Notepad, or (hopefully) they have configured Windows to open .ini and .inc and .txt and such in Notepad++ or Sublime Editor or some other decent text editor.

All you need to do to launch a file in the editor associated with any given extension is to just use:

LeftMouseUpAction=["PathToFile\FileName.ext"]

* You could use a Lua script to read the Rainmeter.ini file, get the string for "ConfigEditor" if it exists, and pass that back to Rainmeter in a bang or variable, but as I said, given that most folks never set that value, it might be a lot more trouble than it is worth, and will fail in any case if Rainmeter.ini is encoded in anything other than ANSI for some reason. (Since Lua hates Unicode)