Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- function on_new_sub(name, text)
- {
- if(text == null || text == "")
- return;
- var newtext = "";
- for(var i = 0; i < text.length; i += 1)
- {
- var c = text[i];
- if(c == "\n" || c == "\r")
- continue;
- else if(c == '"')
- newtext += "”";
- else
- newtext += c;
- }
- //mp.commandv("show-text", newtext);
- //mp.commandv("print-text", newtext);
- var cmd = 'echo "' + newtext + '" | clip';
- //mp.commandv("print-text", cmd);
- mp.command("run cmd /D /C chcp 65001 | " + cmd); // this line may need to be modified to include a chcp 65001 | or chcp 6501 & on some systems
- }
- mp.observe_property("sub-text", "string", on_new_sub);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement