It is currently November 28th, 2021, 6:01 am

## #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

Report bugs with the Rainmeter application and suggest features.
death.crafter
Rainmeter Sage
Posts: 1196
Joined: April 24th, 2021, 8:13 pm

### #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

When I try to send a !SetVariable bang with #CRLF# to Rainmeter.exe, it isn't resolved to a new line character, or it's not resolved at all.

For example:

Code: Select all

"path\to\Rainmeter.exe" "[!SetVariable SomeVariable \"String#CRLF#String\" \"MyConfig\"]"

the variable shows up as String#CRLF#String.

P.S.: Using \n instead of #CRLF# does the job but since #CRLF# is resolved in !SetOption bang when used from outside, I thought it might be a bug.
from the Realm of Death
nek
Posts: 47
Joined: November 3rd, 2019, 12:00 am

### Re: #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

I'm not sure what you are trying to do, but this will work with #CRLF#.
send-crlf02.png

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1

[Variables]

[msRunCommand]
Measure=Plugin
Plugin=RunCommand
Program=""#PROGRAMPATH#Rainmeter.exe""
Parameter=[!SetVariable VAR "1#CRLF#2" "#CURRENTCONFIG#"]

[mtString1]
Meter=String
Text=Onett
Antialias=1
SolidColor=333333FF
FontColor=FFFFFFFF
FontSize=16
LeftMouseUpAction=[!CommandMeasure msRunCommand "Run"]

;; This will create a new process (with wrong parameters?), so I don't use.
;LeftMouseUpAction=["#PROGRAMPATH#Rainmeter.exe" "SomeParameters"]
send-crlf06.png

You might use Process Monitor - Microsoft(Sysinternals) for debugging.
send-crlf04.png
Usage of Process Monitor:
You do not have the required permissions to view the files attached to this post.
death.crafter
Rainmeter Sage
Posts: 1196
Joined: April 24th, 2021, 8:13 pm

### Re: #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

nek wrote: October 3rd, 2021, 12:05 pm I'm not sure what you are trying to do, but this will work with #CRLF#.
send-crlf02.png

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1

[Variables]

[msRunCommand]
Measure=Plugin
Plugin=RunCommand
Program=""#PROGRAMPATH#Rainmeter.exe""
Parameter=[!SetVariable VAR "1#CRLF#2" "#CURRENTCONFIG#"]

[mtString1]
Meter=String
Text=Onett
Antialias=1
SolidColor=333333FF
FontColor=FFFFFFFF
FontSize=16
LeftMouseUpAction=[!CommandMeasure msRunCommand "Run"]

;; This will create a new process (with wrong parameters?), so I don't use.
;LeftMouseUpAction=["#PROGRAMPATH#Rainmeter.exe" "SomeParameters"]
This is because the Parameter option is read by Rainmeter and already resolved before being sent as a parameter.

I am talking about bangs sent from outer sources.
from the Realm of Death
nek
Posts: 47
Joined: November 3rd, 2019, 12:00 am

### Re: #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

I totally misunderstood. Sorry to bother you.

> Skin.cpp - void Skin::SetVariable
Brian
Developer
Posts: 2291
Joined: November 24th, 2011, 1:42 am
Location: Utah

### Re: #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

This isn't a bug since #variables# have no context outside of a skin.

Inside Rainmeter, regular #variables# are parsed and replaced when an option is read. Since you are sending in a variable outside of Rainmeter, there is no parsing.

However....there is a work-around.

https://docs.rainmeter.net/manual/variables/nesting-variables/#Notes

Nested variables are parsed when a bang is executed. So, you could use nested syntax to accomplish this.

"path\to\Rainmeter.exe" "[!SetVariable SomeVariable \"String[#CRLF]String\" \"MyConfig\"]"

-Brian
death.crafter
Rainmeter Sage
Posts: 1196
Joined: April 24th, 2021, 8:13 pm

### Re: #CRLF# is not resolved with !SetVariable bang when used with Rainmeter.exe

Brian wrote: October 3rd, 2021, 7:58 pm This isn't a bug since #variables# have no context outside of a skin.

Inside Rainmeter, regular #variables# are parsed and replaced when an option is read. Since you are sending in a variable outside of Rainmeter, there is no parsing.

However....there is a work-around.

https://docs.rainmeter.net/manual/variables/nesting-variables/#Notes

Nested variables are parsed when a bang is executed. So, you could use nested syntax to accomplish this.

"path\to\Rainmeter.exe" "[!SetVariable SomeVariable \"String[#CRLF]String\" \"MyConfig\"]"

-Brian
Oh my god... How could I not think of that. Now I don't have to setup work arounds.

Thanks, Brian.
from the Realm of Death