Sorry for the confusion, I thought I'd made it clear?
I always seem to pick the awkward things to do in Rainmeter !
I am not trying to copy the icon, I am trying to copy the string.
So if I click on an icon, it copies the text not the icon. Then that text can be used anywhere.
So is that the answer? To escape the variable using two * ?
Thanks for your help
It is currently April 23rd, 2024, 2:23 pm
Click to copy text?
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: Click to copy text?
Actually, the best thing to do is to store the variables as \xmmmm and use it as [#variable#] and use in bang as [*#variable#*]. But I guess you figured that out already.sl23 wrote: ↑September 2nd, 2021, 8:17 am Sorry for the confusion, I thought I'd made it clear?
I always seem to pick the awkward things to do in Rainmeter !
I am not trying to copy the icon, I am trying to copy the string.
So if I click on an icon, it copies the text not the icon. Then that text can be used anywhere.
So is that the answer? To escape the variable using two * ?
Thanks for your help
from the Realm of Death
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Click to copy text?
Not too sure what you mean?
Currently, I have 100 variables per skin. 1 for each icon- Icon1=[\xE123].
Then in meters.Inc file, I have a left click action - LeftMouseUpAction=[!SetClip "[##CurrentSection#]"]. So do you mean I need to escape the variable with * like this - LeftMouseUpAction=[!SetClip "[*##CurrentSection#*]"]?
Ah, just reread it. I think you mean to have the variables without the square brackets and use the call for them to place the brackets. Then I can escape the variable, is that right?
Currently, I have 100 variables per skin. 1 for each icon- Icon1=[\xE123].
Then in meters.Inc file, I have a left click action - LeftMouseUpAction=[!SetClip "[##CurrentSection#]"]. So do you mean I need to escape the variable with * like this - LeftMouseUpAction=[!SetClip "[*##CurrentSection#*]"]?
Ah, just reread it. I think you mean to have the variables without the square brackets and use the call for them to place the brackets. Then I can escape the variable, is that right?
- MuLab -
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Click to copy text?
Yes, like this:sl23 wrote: ↑September 2nd, 2021, 9:45 am Not too sure what you mean?
Currently, I have 100 variables per skin. 1 for each icon- Icon1=[\xE123].
Then in meters.Inc file, I have a left click action - LeftMouseUpAction=[!SetClip "[##CurrentSection#]"]. So do you mean I need to escape the variable with * like this - LeftMouseUpAction=[!SetClip "[*##CurrentSection#*]"]?
Ah, just reread it. I think you mean to have the variables without the square brackets and use the call for them to place the brackets. Then I can escape the variable, is that right?
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
Icon1=\xe756
[MeterOne]
Meter=String
FontSize=30
Text=[#Icon1#]
FontFace=Segoe Fluent Icons
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
LeftMouseUpAction=[!SetClip "[*#Icon1#*]"]
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: Click to copy text?
If you are using vscode or something that has regex substitution, dosl23 wrote: ↑September 2nd, 2021, 9:45 am Not too sure what you mean?
Currently, I have 100 variables per skin. 1 for each icon- Icon1=[\xE123].
Then in meters.Inc file, I have a left click action - LeftMouseUpAction=[!SetClip "[##CurrentSection#]"]. So do you mean I need to escape the variable with * like this - LeftMouseUpAction=[!SetClip "[*##CurrentSection#*]"]?
Ah, just reread it. I think you mean to have the variables without the square brackets and use the call for them to place the brackets. Then I can escape the variable, is that right?
find: ^\s*(?!Text[^\w])([^\s]+)\s*=\s*\[(\\x\w{4})\]\s*$
replace: $1=$2
$1, $2 are capture groups in vscode, you code editor might have different syntax
from the Realm of Death
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Click to copy text?
Thank you for clarifying JSMorley.
@ death.crafter: I assume that's a fine and replace for those 1200 variables?
Well it's probably half that, but thanks I'll take a look when I get time.
@ death.crafter: I assume that's a fine and replace for those 1200 variables?
Well it's probably half that, but thanks I'll take a look when I get time.
- MuLab -
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: Click to copy text?
Well, doesn't matter if it's 1200 or 1200k, regex replace can do it in a blink of an eye.
from the Realm of Death
-
- Rainmeter Sage
- Posts: 16162
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Click to copy text?
It seems I missed somethingjsmorley wrote: ↑September 2nd, 2021, 9:50 am Yes, like this:
Code: Select all
[Rainmeter] Update=1000 DynamicWindowSize=1 AccurateText=1 [Variables] Icon1=\xe756 [MeterOne] Meter=String FontSize=30 Text=[#Icon1#] FontFace=Segoe Fluent Icons FontWeight=400 FontColor=255,255,255,255 SolidColor=47,47,47,255 Padding=5,5,5,5 AntiAlias=1 LeftMouseUpAction=[!SetClip "[*#Icon1#*]"]
A while ago escaping variables were done as [#*Icon1*#], not as [*#Icon1#*]. I checked and the [*#Icon1#*] form is definitely working, however I'm not sure why. This probably is something new (to me definitely).
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: Click to copy text?
Actually what is being escaped here is, [\xe756] as [*\xe756*] to not resolve it to unicode character literal and not [#Icon1#] as [*#Icon1#*]. More like a [*MeasureName*].balala wrote: ↑September 2nd, 2021, 2:26 pm It seems I missed something
A while ago escaping variables were done as [#*Icon1*#], not as [*#Icon1#*]. I checked and the [*#Icon1#*] form is definitely working, however I'm not sure why. This probably is something new (to me definitely).
from the Realm of Death
-
- Rainmeter Sage
- Posts: 16162
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Click to copy text?
death.crafter wrote: ↑September 2nd, 2021, 2:49 pm Actually what is being escaped here is, [\xe756] as [*\xe756*] to not resolve it to unicode character literal and not [#Icon1#] as [*#Icon1#*]. More like a [*MeasureName*].
Makes sense. Missed this, so thanks for the info.