|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Clipboard Commands > Set Clipboard Text > CLB. - Clipboard Operations |
SPR Script Language
CLB.WideFromString
Sets the clipboard with a string converted to a wide string.
Intention
The CLB.WideFromString command in SPR takes a string ($$INP), converts it to a wide string (UTF-16), and sets it as the clipboard content. This allows SPR scripts to place text into the clipboard in a format compatible with applications that expect wide characters, enabling seamless pasting into external tools.
It’s a way for your robot to share text—CLB.WideFromString converts script data to wide text and puts it on the clipboard for other apps to use.
Illustration
📤 Set Text: CLB.WideFromString|Hello World places "Hello World" on the clipboard.
📋 Paste: You can then paste it into any app supporting wide text.
Syntax
CLB.WideFromString|$$INP
Parameter Explanation
P1 - $$INP - (Variable, String)
The string to convert and set on the clipboard (e.g., $$INP as "Hello World"). Required.
Examples
'***********************************
' CLB.WideFromString - Sample 1: Set Simple Text
'***********************************
CLB.WideFromString|Hello World
MBX.Text set to clipboard; paste elsewhere to see "Hello World"
MBX.Ready
'
'***********************************
' CLB.WideFromString - Sample 2: Set Variable Content
'***********************************
$$DATA = "Test Data"
CLB.WideFromString|$$DATA
PRT.Clipboard updated with "Test Data"
MBX.Ready
'
Remarks
- Converts the input string to a wide string (UTF-16) before setting it on the clipboard.
- Overwrites existing clipboard content with the new text.
- Ideal for sharing text with applications expecting wide character formats.
Limitations
- Only sets text data; non-text clipboard formats are not supported.
- Conversion relies on StringToWString; may truncate if input exceeds wide string limits.
See also: