I'm making myself simple script to convert copied text from russian cyrillic to spelling of these letters. I hardcoded some random text like "Вот велосипед" for testing during making it.
Currently I'm using stuff like:
StringReplace, clipboard, clipboard, д, d, All
And when text is hardcoded to clipboard in code it replaces and outputs everything perfectly. But when I set it to really read from clipboard it doesn't do anything - it outputs it the same.
What's going on? How do I make it work?
Is there some unicode clipboard read mode or something?
Edit: As suggested - example of nonworking code - not much more than I wrote earlier really:
^+!F10::
{
clipboard = Вот велосипед
StringReplace, clipboard, clipboard, д, d, All
Msgbox,%clipboard%
}
return
Outputs "Вот велосипед" - "д" at the end is replaced. But if I remove this "clipboard = Вот велосипед" line and copy it myself instead - it'll not work - "д" is not replaced. Weird
Related
I have a script in SSMS
I would like to copy it, complete with formatting and color-coding to Word
When I paste, it pastes as plain text
When I right-click in Word, I only get the option to paste as plain text (no option to paste and keep source formatting)
I've pasted from SSMS into Word before and never had an issue
Found out how to make it paste correctly -
I copied half of the script, pasted, copied the second half, pasted
It might be an issue with the number of lines/size of the script?
The script is only 316 lines - so not sure
I searched everywhere for this, the problem is that the search criteria is very similar to other questions.
The issue I have is that file (script actually) is embedded in another file. So when I open the parent file I can see the script as massive string with several \n and \r\n codes. I need a way to convert these codes to what they should be so that it formats the code correctly then I can read said code and work on it.
Quick snippet:
\n\n\n\n\nlocal scriptingFunctions\n\n\n\n\nlocal measuringCircles = {}\r\nlocal isCurrentlyCheckingCoherency
Should covert to:
local scriptingFunctions
local measuringCircles = {}
local isCurrentlyCheckingCoherency
perform a Regex Find-Replace
Find: (\\r)?\\n
Replace: \n
If you don't need to reconvert from newlines to \n after you're done working on the code, you can accomplish the trick by simply pressing ctrl-f and substituting every occurrence of \n with a new line (you can type enter in the replace box by pressing ctrl-enter or shift-enter).
See an example ctrl-f to do this:
If after you're done working on the code you need to reconvert to \n, you can add an invisible char to the replace string (typing it like ctrl-enter invisibleChar), and after you're done you can re-replace it with \n.
There's plenty of invisible chars, but I'd personally suggest [U+200b] (you can copy it from here); another good one is [U+2800] (⠀), as it renders as a normal whitespace, and thus is noticeable.
A thing to notice is that recent versions of vscode will show a highlight around invisible chars, but you can easily disable it by clicking on Adjust settings and then selecting Exclude from being highlighted.
If you need to reenable highlighting in the future, you'll have to look for "editor.unicodeHighlight.allowedCharacters" in the settings.
I am new to notepad++ and like it very much, since I can customize how my text documents look more easily than with wordpad. However, I would like to know if it’s possible to enter accented characters like in wordpad (I thought it was a windows thing, but perhaps it isn’t). In wordpad, I can type, for instance, ctrl-’ then i to get an accented í character. Similarly, I can type ctrl-shift-~ then n to get the accented ñ character. It makes it much easier to enter accented characters than copying and pasting from the character map application, or trying to remember code points. When I tried this method in notepad++ I just got the plain character without the accents. I should also mention that when I open documents with such accented characters already present they appear just as expected. Is there a way to enter accented characters like this in notepad++ using only the keyboard? I am using the latest notepad++ under Windows 7.
In Notepad++ you can go to “Edit” then select “Character Panel” near the bottom of the drop down menu. It will show you the ASCII set available which includes most accented characters. You find the character you want and there will be a number for it, to easily use that, press and hold your ALT key, then, on your keypad on the right side of your keyboard type zero followed by the number for that character. So for something like “ñ” for example, the code for it is 241, so you would press ALT and then type 0241 on the keypad while holding down ALT and you will get the character you need. That works in most Windows programs, even in here.
This only works for ASCII characters in the range of 0 to 255. I don't know of a method other than copying and pasting from the “Character Map” app available in Windows for Unicode. Though I did test Wordpad with the Decimal number of the Hex value you see for a Unicode character above 255 and it will work with the ALT+#### in there, and probably other places, but it doesn't work in Notepad or Notepad++ for some strange reason, sadly. Two I use a lot and have memorized are ALT+0147 and ALT+0148 for the quotation marks “like these”, so once you use the numbers enough you tend to get used to them, or you can jot down the ones you use the most.
For anyone searching for a solution and coming across this page, try this (Windows): install and use the US International keyboard instead of the plain US keyboard. Search for "windows keyboard us international install" or something similar. I liked the techlanguage.com write-up on it and the teckangaroo.com step by step on how to install. Hope this helps someone in future looking around as I was earlier today for how to easily meet this need.
You can make your own keyboard layout to enter arbitrary characters anywhere in Windows, using MSKLC. Here's one I made earlier.
I think it is configured in the input method. With input method containing the characters you mentioned, you can press key combinations to get special letters.
You can add a keyboard layout preset in Windows. Under "Language and Regions" - "Language" - "Language settings" - "Input method" settings in Control Panel, you can add all what you want. Like this:
Switch keyboard layout with Alt + Shift.
I am using the function dlmcell in Matlab to output text. I want text on a new line each time I append using dlmcell.
When I open my written document in Notepad++, each snippet of text is on a new line as I want it. However, opening it in Notepad that comes with windows, everything is on the same line. Can somebody tell me why this is, and how to fix it?
I'm assuming you're using the string \n to declare a new line in your output. For Notepad++ this is sufficient, because it interprets a new line just with \n. For the Windows Editor you need to include the carriage return also:
substitute:
\n with \r\n
This way not just a new line is created, it also tells the editor to actually continue on the next line.
To illustrate what I mean, open your output file with Notepad++ and activate View > Show Symbol > All characters and you will see something like:
I wrote this with Notepad++ and it automatically adds CR (carriage return) and LF (line feed) at the end of every line. Matlab doesn't if you don't tell it. So your output file only contains LF without the above mentioned substitution.
I've had a look into dlmcell, which is a FEX-function. In the current version \r\n is implemented actually. Do you have the newest version of that function (Download)? If not, something else must be wrong, please post some code.
I am an Autohotkey user. How can I make some text in clipboard having bold style. Actually, I want to get some text as input from clipboard and then change style (bold or unbold) of some words in there and eventually to paste the enhanced text to where it was previously copied. Also notice that the existing format of the text is important (thus using ClipboardAll) and I don't want to lose the original format; just to change / modify style of some words in there.
Any idea / clue to accomplish this?
Thanks
I assume you're working in word or some other text editor that allows Ctrl+B to bold highlighted text. Something like this should work.
clipboard =
ClipWait,,
OutVar := StrLen(clipboard)
;put code for navigating to your paste place here
send,^v
send,{Shift Down}
send,{Left %OutVar%}
send,{Shift Up}
send,^b
send,{end}
;send,%OutVar%
I'm kind of an amateur at this, but I tested it and it seems to work if you want to bold the entire clipboard. If you're bolding only certain words within a clipboard... I'm not sure. Personally, I would create a script that transfers the clipboard to Word or some other rich text editor, then use ^f to find the words I'm looking for (using input or InputBox), and then bolding those words in the style used above, and then copy/pasting the finished work to the final destination.
But there's probably an easier way to do it...
EDIT: InStr() might help you there... check the AutoHotkey help for more info about InStr().