It is currently March 29th, 2024, 12:04 pm

How to make the ContextAction open a file (or an .ini) in a text editor

Get help with creating, editing & fixing problems with skins
Rafamear
Posts: 114
Joined: November 15th, 2021, 1:47 am
Location: Brazil

How to make the ContextAction open a file (or an .ini) in a text editor

Post by Rafamear »

I was making my skin with a custom context menu, and I wanted to add some options like editing the skin or it opening a .ini but I didn't find any way to do it is there any way to do that?
;===========================================Rafamear=================================================
;========================= :welcome: ========== My DeviantArt ========== :Whistle ==============================
User avatar
DanDaBear
Posts: 109
Joined: February 23rd, 2018, 3:12 am
Location: United States

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by DanDaBear »

Hi Rafamear,

My context menu looks like this:
Screenshot 2022-05-06 194521.png
Code is here:

Code: Select all

RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Drop Top Settings Menu
ContextAction=[!ActivateConfig "#ROOTCONFIG#" "Settings.ini"]
ContextTitle2=----
ContextAction2=[]
ContextTitle3=Edit Global Variables
ContextAction3=["#@#\IncludeFiles\GlobalVariables.inc"]
ContextTitle4=Edit #CURRENTFILE#
ContextAction4=["#CONFIGEDITOR#" "#CURRENTPATH##CURRENTFILE#"]
ContextTitle5=----
ContextAction5=[]
ContextTitle6=Open @Resources Folder
ContextAction6=["#@#"]
ContextTitle7=Open Include Files Folder
ContextAction7=["#@#\IncludeFiles"]
ContextTitle8=----
ContextAction8=[]
ContextTitle9=Manage "#CURRENTFILE#"
ContextAction9=[!Manage Skins "#CURRENTCONFIG#" "#CURRENTFILE#"]
ContextTitle10=Refresh Skin
ContextAction10=[!Refresh]
ContextTitle11=---
ContextAction11=[]
ContextTitle12=- - - - More actions - - - -
ContextAction12=[!SkinMenu]
ContextTitle13=---
ContextAction13=[]
---- More Actions ---- opens the regular context menu
You do not have the required permissions to view the files attached to this post.
Never underestimate the power of stupid! :D
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by CodeCode »

There is also a way to have a skin specific file associated with the context menu.
Courtesy of Active Colors:

Code: Select all

MouseOverAction=[!SetOption Rainmeter ContextTitle2 "Open Weather Settings"][!SetOption Rainmeter ContextAction2 """["#CURRENTPATH#Weather Wizard.inc"]"""]
It goes in the meter associated with a skin area, such as a clickable area image etc.

I use it like shown in a transparent overlay for the whole skin. Not a universal type of menu - it is skin specific. You can set the ContextTitle'x' and ContextAction'x' to fit either at the beginning or end of a context menu - not sure if it works in the middle.

Hope that provides some additional info you might like to use sometime.

This is good if your settings are different for skins in a suite, for example.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by balala »

DanDaBear wrote: May 6th, 2022, 11:48 pm Code is here:
Just to be extremely precise and because you didn1t specify this, note that these options have to be added to the [Rainmeter] section:

Code: Select all

[Rainmeter]
...
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Drop Top Settings Menu
ContextAction=[!ActivateConfig "#ROOTCONFIG#" "Settings.ini"]
ContextTitle2=----
ContextAction2=[]
ContextTitle3=Edit Global Variables
ContextAction3=["#@#\IncludeFiles\GlobalVariables.inc"]
ContextTitle4=Edit #CURRENTFILE#
ContextAction4=["#CONFIGEDITOR#" "#CURRENTPATH##CURRENTFILE#"]
ContextTitle5=----
ContextAction5=[]
ContextTitle6=Open @Resources Folder
ContextAction6=["#@#"]
ContextTitle7=Open Include Files Folder
ContextAction7=["#@#\IncludeFiles"]
ContextTitle8=----
ContextAction8=[]
ContextTitle9=Manage "#CURRENTFILE#"
ContextAction9=[!Manage Skins "#CURRENTCONFIG#" "#CURRENTFILE#"]
ContextTitle10=Refresh Skin
ContextAction10=[!Refresh]
ContextTitle11=---
ContextAction11=[]
ContextTitle12=- - - - More actions - - - -
ContextAction12=[!SkinMenu]
ContextTitle13=---
ContextAction13=[]
This detail might be extremely important for a beginner (which OP I believe is).
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by CodeCode »

balala wrote: May 7th, 2022, 7:36 pm Just to be extremely precise and because you didn1t specify this, note that these options have to be added to the [Rainmeter] section:

Code: Select all

[Rainmeter]
...
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Drop Top Settings Menu
ContextAction=[!ActivateConfig "#ROOTCONFIG#" "Settings.ini"]
ContextTitle2=----
ContextAction2=[]
ContextTitle3=Edit Global Variables
ContextAction3=["#@#\IncludeFiles\GlobalVariables.inc"]
ContextTitle4=Edit #CURRENTFILE#
ContextAction4=["#CONFIGEDITOR#" "#CURRENTPATH##CURRENTFILE#"]
ContextTitle5=----
ContextAction5=[]
ContextTitle6=Open @Resources Folder
ContextAction6=["#@#"]
ContextTitle7=Open Include Files Folder
ContextAction7=["#@#\IncludeFiles"]
ContextTitle8=----
ContextAction8=[]
ContextTitle9=Manage "#CURRENTFILE#"
ContextAction9=[!Manage Skins "#CURRENTCONFIG#" "#CURRENTFILE#"]
ContextTitle10=Refresh Skin
ContextAction10=[!Refresh]
ContextTitle11=---
ContextAction11=[]
ContextTitle12=- - - - More actions - - - -
ContextAction12=[!SkinMenu]
ContextTitle13=---
ContextAction13=[]
This detail might be extremely important for a beginner (which OP I believe is).
Wow. That is cool - using the built-in variables like that. Ill save this stuff to my tricks and tips file. :thumbup:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by balala »

CodeCode wrote: May 7th, 2022, 11:35 pm Wow. That is cool - using the built-in variables like that. Ill save this stuff to my tricks and tips file. :thumbup:
That's not my code at all. I just reposted DanDaBear's above code, adding the [Rainmeter] section name, to let OP knows where to put the options. So credits are going to him...
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by CodeCode »

Apologies DanDaBear. I totally missed your part in that, scrolling to the end before reading the former.
:thumbup: :oops:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
DanDaBear
Posts: 109
Joined: February 23rd, 2018, 3:12 am
Location: United States

Re: How to make the ContextAction open a file (or an .ini) in a text editor

Post by DanDaBear »

No problem CodeCode. I probably got the idea from somewhere here on the forums. :Whistle
Never underestimate the power of stupid! :D