It is currently April 26th, 2024, 2:21 am

Click to copy text?

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Click to copy text?

Post by balala »

sl23 wrote: September 1st, 2021, 4:53 pm I tried the code supplied by eclectic-tech above, but when pasted, I just get a strange character instead of the actual text. Any idea on how to fix this?
Check the encoding of your .ini file. It should be UTF-16 LE (Notepad) or UCS-2 LE BOM (Notepad++) (these are in fact the same, just are named differently in the two editors). More details here.
sl23 wrote: September 1st, 2021, 4:53 pm According to the manual, this is a limited operation. Meaning you can't specify something like:
[!SetClip sAllIcons Text "[##CURRENTSECTION#]"]
Or whatever would be required to set text from the current meter.
No, you really can't, because the !SetClip bang needs / accepts only one single parameter: the string which are copied to clipboard.
sl23 wrote: September 1st, 2021, 4:53 pm Here's what I have in the Style section that activates the copy. I tried the !SetClip at the beginning and here, in the middle to see if the order mattered:

Code: Select all

[sAllIcons]
FontFace=Segoe Fluent Icons
FontSize=14
FontColor=#Color1#
AntiAlias=1
Text=[##CURRENTSECTION#]
LeftMouseUpAction=[!EnableMouseAction * "MouseOverAction|MouseLeaveAction"] [!SetClip "[##CURRENTSECTION#]"][!SetVariable Preview [##CURRENTSECTION#]] [!SetOptionGroup Preview FontColor "#Color1#"] [!UpdateMeterGroup Preview] [!SetOption #CURRENTSECTION# FontColor "#Color4#"] [!UpdateMeter #CURRENTSECTION#] [!Redraw] [!DisableMouseAction #CurrentSection# "MouseOverAction|MouseLeaveAction"]
UpdateDivider=-1
DynamicVariables=1
X=185
Y=5R
And did the order matter?
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

Tried to paste the copied text into Notepad, Notepad++ and my normal editor, SynWrite. None show the correct text, just the icon, even though I saved the file as UTF-16 LE. There is no UCS-2 LE in NotePad++ that I could find, just the UTF-16 LE BOM.

SynWrite shows the text just as it appears in the forum here, but with a ? in the middle instead of the letters seen here... 

The order of the placement of the Bang didn't appear to change anything.

Could the problem with the paste not showing correctly be due to the fact the font isn't installed on my system? That seems a probable cause... I'll try to install it and see if that works.

Installed font, set SynWrite to use UTF-16 encoding, copied and pasted the text and it appeared exactly as before. This time, I saved it, restarted the app by opening the file I used to save it, and instead of the little box with a tiny question mark in it, i got...? Yes, that's what I got, a plain old ? Why is that happening? :confused:
Last edited by sl23 on September 1st, 2021, 9:04 pm, edited 1 time in total.
- MuLab -
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Click to copy text?

Post by jsmorley »

Don't worry about what is displayed in your text editor. Those are going to be using some vanilla monospace font, and almost certainly won't display any unusual characters in the text editor itself. All that matters is what is displayed in the skin.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

But it just pastes a ? no text is pasted. Meaning that the skin will display exactly that. Surely the purpose is to copy the text exactly as it appears when I open the skin file?
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

Just tried this in CudaText, same issue. I think it's not copying correctly?
- MuLab -
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Click to copy text?

Post by jsmorley »

sl23 wrote: September 1st, 2021, 9:05 pm But it just pastes a ? no text is pasted. Meaning that the skin will display exactly that. Surely the purpose is to copy the text exactly as it appears when I open the skin file?
I would not even try to directly paste any character that isn't the standard Unicode characters included with most fonts into your text editor. You are better off to use [\x001] character references in the skin .ini file.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

I'm not trying to, I just thought that may be what is happening.

What I would like is to copy the text as it appears in the Variable:

Code: Select all

Icon1=[\xE756]
Icon2=[\xE71D]
Icon3=[\xE74C]
Icon4=[\xE83D]
Icon5=[\xF0FB]
etc...
But I'm just not getting that. Is it due to not having a measure to copy from? :???:
- MuLab -
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Click to copy text?

Post by jsmorley »

I guess I don't really understand.

If I have this skin:

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#"]
I get this:
1.png


If I click on it, it copies the character into the clipboard, but I can't paste it anywhere where it is going to display as other than some "unknown" symbol. Not even the WIN-V clipboard viewer in Windows will be able to display it. Only some application that is specifically told to use the font "Segoe Fluent Icons" is ever going to display it.

When I use the skin and click on the character, the symbol is certainly copied into the clipboard, but when I paste it in and replace the variable with the copied character, I get this:
2.png



As you can see, the text editor cannot display it. However, if I save that and refresh the skin it displays the character just fine.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Click to copy text?

Post by jsmorley »

If the idea is that you are going to display some characters that are part of some symbol font, have a user click on the character, copy the character to the clipboard, and have them paste it into a skin .ini, or really into pretty much anything, and have it work right, it won't... Copy the [\xe756] character reference as a literal string, and have them paste that.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Click to copy text?

Post by death.crafter »

jsmorley wrote: September 1st, 2021, 9:40 pm I guess I don't really understand.

If I have this skin:

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#"]
I get this:

1.png



If I click on it, it copies the character into the clipboard, but I can't paste it anywhere where it is going to display as other than some "unknown" symbol. Not even the WIN-V clipboard viewer in Windows will be able to display it.

When I use the skin and click on the character, the symbol is certainly copied into the clipboard, but when I paste it in and replace the variable with the copied character, I get this:

2.png




As you can see, the text editor cannot display it. However, if I save that and refresh the skin it displays the character just fine.
What happens when you use the bang in Rainmeter section?
from the Realm of Death