I was building a custom menu to replace the standard one on this skin and found bangs to replace most of the original context commands I cared about. But I can't figure out one for 'edit skin.'
I can get close but I want the default rainmeter editor which isn't always the default editor. And I'm not quite sure which is the right method to approach this with in the first place.
Surprised there is not an !EditSkin considering you have everything other context menu item covered, What would the correct command be?
Thanks.
It is currently March 28th, 2024, 7:24 pm
Simulating the Edit Skin feature of the comtext menu from within a skin.
-
- Posts: 97
- Joined: May 29th, 2017, 3:16 pm
Simulating the Edit Skin feature of the comtext menu from within a skin.
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
-
- Posts: 97
- Joined: May 29th, 2017, 3:16 pm
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
Sorry, must have explained myself poorly. I am building a custom context menu. One of the items I wish to have on it is the editing of the skin. So I need a bang or bang initialed sequence of events that will execute the default text editor as set in rainmeter and load the current skin.dvo wrote:in standaard menu under settings you can setup your own editor ....
after that you can select any ini file in your skin you want to edit by clicking right mouse button and pick edit...
this will open your editor.....
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
dvo, I think you've misunderstood the question.dvo wrote:in standaard menu under settings you can setup your own editor ....
after that you can select any ini file in your skin you want to edit by clicking right mouse button and pick edit...
this will open your editor.....
The question was how to create a context menu entry, to edit the code.
That's also possible, eg using the #CURRENTPATH# and #CURRENTFILE# variables:Codger wrote:I can get close but I want the default rainmeter editor which isn't always the default editor. And I'm not quite sure which is the right method to approach this with in the first place.
Code: Select all
[Rainmeter]
...
ContextTitle=Edit my skin
ContextAction=["#CURRENTPATH##CURRENTFILE#"]
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
There currently is really no easy way to do this that is certain to obey the same rules simply right-clicking the skin and saying "edit skin" will follow. The line:
ConfigEditor=C:\Program Files (x86)\Notepad++\Notepad++.exe
Is an optional setting that for most people probably won't be there. The default for Rainmeter is to edit skins using whatever text editor in Windows is associated with .ini files, which for most will be Window's Notepad.exe.
You could in theory use WebParser to look for and get this value from
URL=file://#SETTINGSPATH#Rainmeter.ini
So assuming you have that in a WebParser child measure, you could:
SomeAction=["[MeasureEditor]" "#CURRENTPATH##CURRENTFILE#"]
You will need to use a lookahead assertion when getting the ConfigEditor setting from Rainmeter.ini, and react to the value being "" by using !SetOption to change change that action to:
SomeAction=["#CURRENTPATH##CURRENTFILE#"]
instead, which will open it with whatever text editor is associated in Windows.
ConfigEditor=C:\Program Files (x86)\Notepad++\Notepad++.exe
Is an optional setting that for most people probably won't be there. The default for Rainmeter is to edit skins using whatever text editor in Windows is associated with .ini files, which for most will be Window's Notepad.exe.
You could in theory use WebParser to look for and get this value from
URL=file://#SETTINGSPATH#Rainmeter.ini
So assuming you have that in a WebParser child measure, you could:
SomeAction=["[MeasureEditor]" "#CURRENTPATH##CURRENTFILE#"]
You will need to use a lookahead assertion when getting the ConfigEditor setting from Rainmeter.ini, and react to the value being "" by using !SetOption to change change that action to:
SomeAction=["#CURRENTPATH##CURRENTFILE#"]
instead, which will open it with whatever text editor is associated in Windows.
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
The reason we have not added a bang to do this is because the logic of it is that probably 99.9% of the time, if folks install a text editor like Notepad++ or Sublime to use with Rainmeter, they are going to associate .ini and .inc files with that editor, since a great deal of the time they are editing the skin entirely outside of Rainmeter.
They are not using Manage or the context menus and saying "Edit skin", but just opening the Skins folder and double-clicking the file or right-clicking it in Windows Explorer. Since ConfigEditor in Rainmeter.ini isn't in the mix then, they are going to end up frustrated and just changing the association in Windows to the right thing. So then there is never any need to be specific about what text editor to use, and simply:
SomeAction=["#CURRENTPATH##CURRENTFILE#"]
Always works correctly.
Not saying new bang is a bad idea mind you, just for completeness' sake.
They are not using Manage or the context menus and saying "Edit skin", but just opening the Skins folder and double-clicking the file or right-clicking it in Windows Explorer. Since ConfigEditor in Rainmeter.ini isn't in the mix then, they are going to end up frustrated and just changing the association in Windows to the right thing. So then there is never any need to be specific about what text editor to use, and simply:
SomeAction=["#CURRENTPATH##CURRENTFILE#"]
Always works correctly.
Not saying new bang is a bad idea mind you, just for completeness' sake.
-
- Posts: 97
- Joined: May 29th, 2017, 3:16 pm
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
See the power of having that 'sage' tag? I try that (the second thing I tried I think) and it fired the windows default editor. You write it and works just dandy,balala wrote:
That's also possible, eg using the #CURRENTPATH# and #CURRENTFILE# variables:#CURRENTPATH# returns the path of the skin, while #CURRENTFILE# returns the name of the file. This way when you click the "Edit my skin" menu, the appropriate file will be loaded, into the default text editor, set, as dvo said, in the Editor field of the Settings tab, of the Manage Rainmeter window.Code: Select all
[Rainmeter] ... ContextTitle=Edit my skin ContextAction=["#CURRENTPATH##CURRENTFILE#"]
Thank you. It is now my first completed widget skin for public consumption. Though as someone pointed out I will have to go back and make the weather part international at some point.
Thanks again.
You do not have the required permissions to view the files attached to this post.
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
What has been said here is just not accurate.
If you simply open the file with:
LeftMouseUpAction=["#CURRENTPATH##CURRENTFILE#"]
That DOES NOT obey the ConfigEditor setting in Rainmeter.ini, but simply opens the .ini file in the default text editor associated in Windows.
As I said, 99.9% of the time that is going to be fine, but it is not fool-proof or perfect. If you want it to be sure to open with ConfigEditor, you have no choice but to go get the path to that from Rainmeter.ini.
If you simply open the file with:
LeftMouseUpAction=["#CURRENTPATH##CURRENTFILE#"]
That DOES NOT obey the ConfigEditor setting in Rainmeter.ini, but simply opens the .ini file in the default text editor associated in Windows.
As I said, 99.9% of the time that is going to be fine, but it is not fool-proof or perfect. If you want it to be sure to open with ConfigEditor, you have no choice but to go get the path to that from Rainmeter.ini.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
Glad to help.
But don't forget to read jsmorley's above replies. Have a lot of good to know details.
But don't forget to read jsmorley's above replies. Have a lot of good to know details.
-
- Posts: 97
- Joined: May 29th, 2017, 3:16 pm
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
I see what happened. I accidentally reset the editor preference to match. I'm glad you caught that.jsmorley wrote:What has been said here is just not accurate.
If you simply open the file with:
LeftMouseUpAction=["#CURRENTPATH##CURRENTFILE#"]
That DOES NOT obey the ConfigEditor setting in Rainmeter.ini, but simply opens the .ini file in the default text editor associated in Windows.
As I said, 99.9% of the time that is going to be fine, but it is not fool-proof or perfect. If you want it to be sure to open with ConfigEditor, you have no choice but to go get the path to that from Rainmeter.ini.
I unfortunately am one of those other .1% because my regular editor is more Thai keyboard friendly but it's lousy for coding.
But as you already helped me figure out how to read and .ini file I'll just port that offer and 'ConfigEditor' completes what I needed to know. A mighty thank you to you all. I'll stitch it all together tomorrow. I feel confident.
Oh, while I've got you on the line
I'd like to be able to enter the zip code via the context menu rather than just editing the skin. I assume data entry is a .lua thing‽ Could you point me in a couple good directions? Thanks.
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Simulating the Edit Skin feature of the comtext menu from within a skin.
No, you will not be able to enter anything via the context menus. That is just not what they are for or how they work in Windows.
If you want to collect user input and write it to a file, you will have to use the InputText plugin. While you can have a bang trigger the InputText field, it won't be related to the context menu, but just some input box that will open up on the skin and take mouse focus. Driving that with the context menu is going to be ugly and not the right way to get there.
If you want to collect user input and write it to a file, you will have to use the InputText plugin. While you can have a bang trigger the InputText field, it won't be related to the context menu, but just some input box that will open up on the skin and take mouse focus. Driving that with the context menu is going to be ugly and not the right way to get there.