Relative Path and ContextMenu command

Report bugs with the Rainmeter application and suggest features.

Relative Path and ContextMenu command

June 3rd, 2018, 12:30 pm
oZone
   [12 posts]

I have some issues with using relative path in FileView plugin ContextMenu command.
Properties command is working fine.

below is part of my code

Code: Select all

[Variables]
Launcher1_1_File=#PROGRAMPATH#..\SomeFolder\SomeFile.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
MeterStyle=sLauncher
RightMouseDownAction=!CommandMeasure "LauncherContext" "ContextMenu [#[#CURRENTSECTION]_File]"
User avatar

Re: Relative Path and ContextMenu command

June 3rd, 2018, 1:21 pm
jsmorley
Developer   [17683 posts]

oZone wrote:I have some issues with using relative path in FileView plugin ContextMenu command.
Properties command is working fine.

below is part of my code

Code: Select all

[Variables]
Launcher1_1_File=#PROGRAMPATH#..\SomeFolder\SomeFile.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
MeterStyle=sLauncher
RightMouseDownAction=!CommandMeasure "LauncherContext" "ContextMenu [#[#CURRENTSECTION]_File]"


You really can't do that. The ContextMenu command in FileView acts on the file currently selected by the plugin, not a file you can specify in the bang.

Re: Relative Path and ContextMenu command

June 3rd, 2018, 1:45 pm
oZone
   [12 posts]

But according to https://docs.rainmeter.net/manual-beta/ ... ontextMenu
I can manually define file path, and if I use absolute path it will work
User avatar

Re: Relative Path and ContextMenu command

June 3rd, 2018, 3:38 pm
jsmorley
Developer   [17683 posts]

Ah, you are right. Sorry I missed that... I'm not sure then. I think we might need brian, who is much more familiar with the plugin, to weigh in. It is possible that the ContextMenu option doesn't work with relative paths.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Launcher1_1_File=#PROGRAMPATH#..\Speccy\Speccy.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
W=50
H=50
SolidColor=255,0,0,255
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure LauncherContext "ContextMenu [#[#CURRENTSECTION]_File]"]


Cannot open context menu for "C:\Program Files\Rainmeter\..\Speccy\Speccy.exe" (@Working\Test.ini - [LauncherContext])
User avatar

Re: Relative Path and ContextMenu command

June 3rd, 2018, 3:46 pm
jsmorley
Developer   [17683 posts]

This works for me...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Launcher1_1_File=%PROGRAMFILES%\Speccy\Speccy.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
W=50
H=50
SolidColor=255,0,0,255
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure LauncherContext "ContextMenu [#[#CURRENTSECTION]_File]"]


So I'm using the value of the DOS variable %PROGRAMFILES%, which for me is C:\Program Files, and don't need to use a relative path from the Rainmeter folder.

Re: Relative Path and ContextMenu command

June 3rd, 2018, 4:08 pm
oZone
   [12 posts]

I know about this, but I am using Rainmeter in portable mode on USB.
Currently I am using workaround with variable #PROGRAMDRIVE#, but I still prefer relative path from Rainmeter folder.

It's interesting that Properties command doesn't have this issue.
User avatar

Re: Relative Path and ContextMenu command

June 4th, 2018, 5:15 am
Brian
Developer   [1691 posts]

oZone wrote:It's interesting that Properties command doesn't have this issue.

A file's context menu and properties are accessed in different ways, but both send the path directly to Windows to process. Apparently the properties version resolves relative paths, while the other does not.

This has been fixed for the next beta.

-Brian

Return to “Bugs & Feature Suggestions”



Who is online

Users browsing this forum: No registered users and 3 guests