Page 1 of 1

Relative Path and ContextMenu command

Posted: June 3rd, 2018, 12:30 pm
by oZone
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]"

Re: Relative Path and ContextMenu command

Posted: June 3rd, 2018, 1:21 pm
by jsmorley
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

Posted: June 3rd, 2018, 1:45 pm
by oZone
But according to https://docs.rainmeter.net/manual-beta/plugins/fileview/#ContextMenu
I can manually define file path, and if I use absolute path it will work

Re: Relative Path and ContextMenu command

Posted: June 3rd, 2018, 3:38 pm
by jsmorley
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])

Re: Relative Path and ContextMenu command

Posted: June 3rd, 2018, 3:46 pm
by jsmorley
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

Posted: June 3rd, 2018, 4:08 pm
by oZone
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.

Re: Relative Path and ContextMenu command

Posted: June 4th, 2018, 5:15 am
by Brian
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