qwert Posted March 5, 2015 Share Posted March 5, 2015 For the umpteenth time, I'm baffled in moving a code snippet from a forum post to my script in SciTE. The attached screen capture shows a code segment posted by Yashied. When I highlight and drag to SciTE, I end up with one long line: $hForm = GUICreate('MyGUI', 400, 400) GUISetState() While 1 Switch GUIGetMsg() Case -3 WinSetTrans($hForm, '', 0) GUISetState(@SW_HIDE) ExitLoop EndSwitch WEnd Sleep(1000) And it doesn't matter whether the target application is SciTE, NotePad, WordPad or another text processor. Code segments with the Popup tab work properly ... with either drag/drop or cut/paste. Are the CRs/LFs removed by the OS? ... my browser? ... unknown forces? Is there an SciTE "receive code" setting? Thanks for any help. Link to comment Share on other sites More sharing options...
JohnOne Posted March 5, 2015 Share Posted March 5, 2015 Copy Paste AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Geir1983 Posted March 5, 2015 Share Posted March 5, 2015 Yeah ive observed the same behavior.. Its pretty annoying having to manually insert linebreaks Link to comment Share on other sites More sharing options...
jguinch Posted March 5, 2015 Share Posted March 5, 2015 I had the same issue with Firefox. The only way I found was to select the whole code exept the last caracter (or the first), copy/paste and then enter the last caracter manually in Scite. Geir1983 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
ricky Posted March 5, 2015 Share Posted March 5, 2015 Hello, or you can use the very useful extension for firefox : '?do=embed' frameborder='0' data-embedContent>> Link to comment Share on other sites More sharing options...
qwert Posted March 5, 2015 Author Share Posted March 5, 2015 Thanks for all the suggestions. I forgot to mention that Cut/Paste does not work ... not in its standard way. But thanks to jguinch for the following ... which does let cut/paste work: select the whole code except the last caracter I also tried the extension, with has a Edit in SciTE menu entry. It works as advertised, but it's a lot of extra baggage unless you're going to use all the other features. Plus, to get the snippet into your script, you still have to cut/paste after it's in SciTE. Regardless, this is an annoyance that should be able to be corrected in the mechanics of the forum. I'd be interested in hearing if anything has been tried. Surely, it's not by design. In the mean time, the above method solves it for me. Thanks, jguinch! Link to comment Share on other sites More sharing options...
jguinch Posted March 5, 2015 Share Posted March 5, 2015 You're welcome Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JohnOne Posted March 5, 2015 Share Posted March 5, 2015 I do not see an issue with chrome. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
water Posted March 5, 2015 Share Posted March 5, 2015 It's a genuine FF problem! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
qwert Posted March 5, 2015 Author Share Posted March 5, 2015 Also forgot to mention: I use Pale Moon ... originally a fork of FireFox ... now an independent development ... but compatible with many FF addons. (for reference: http://www.palemoon.org/ ) Link to comment Share on other sites More sharing options...
JohnOne Posted March 5, 2015 Share Posted March 5, 2015 I suppose you could write a clipboard managing script, if it detects AutoIt code it makes the necessary changes. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
qwert Posted March 5, 2015 Author Share Posted March 5, 2015 ... it makes the necessary changes ... ... which begs the question: what's included with that last character? Link to comment Share on other sites More sharing options...
JohnOne Posted March 5, 2015 Share Posted March 5, 2015 Not sure it matters, just try StringStripWS($string, 2) Strip all trailing whitspace. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
qwert Posted March 5, 2015 Author Share Posted March 5, 2015 That might, indeed, work. But can anyone explain why I can drag/drop or cut/paste a comment block from the forum, but not a code snippet? They look essentially the same on the screen and behave the same in the drag operation. It tells me that something extra (or less) is being put into the element. Since SciTE is usually the source of code, is it involved? Maybe someone can (soon) try posting a snippet from a word processor. Link to comment Share on other sites More sharing options...
JohnOne Posted March 5, 2015 Share Posted March 5, 2015 (edited) Actually that does not work. When the whole thing is copied as opposed to leaving out the last character. @CR and @LF are replaced with a single SPACE. Edited March 5, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
qwert Posted March 5, 2015 Author Share Posted March 5, 2015 I just pasted verbatim into a WP and got the result shown below. There's a lot involved behind the scenes with those few lines of displayed code. Ideas, anyone? Link to comment Share on other sites More sharing options...
Geir1983 Posted March 5, 2015 Share Posted March 5, 2015 I had the same issue with Firefox. The only way I found was to select the whole code exept the last caracter (or the first), copy/paste and then enter the last caracter manually in Scite. Thanks, this was helpful. I also noticed that it works fine when you can get the code to a pop-up window. Link to comment Share on other sites More sharing options...
JohnOne Posted March 5, 2015 Share Posted March 5, 2015 Report bug to mozilla AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
qwert Posted March 5, 2015 Author Share Posted March 5, 2015 I found the "reasoning" over on the Pale Moon forum in a 2012 post: There is only one way to paste with all formatting from Pale Moon or Firefox, i.e. through the Firefox/Pale Moon Add-On called “Fire IE”. “Fire IE” allows you to display Web pages in tabs using the IE rendering engine. When the page is displaying through the IE engine, you can copy/paste into most applications and keep the formatting. There is a dual reason for this: 1. IE has an internal HTML to RTF converter. So it sends the copied contents both as HTML and RTF to the clipboard (plus a “pure text” version). 2. A number of applications, including some word processors, have no support for the HTML format of the Windows clipboard. If they cannot find a RTF version in the clipboard, they use the default “pure text” version. This is why formatting is lost: such applications don’t support the HTML clipboard contents, and they don’t get the RTF version from Pale Moon or Firefox. Catch-22. You need the IE rendering engine. Catch-22, indeed. And it sounds like no "fix" is forthcoming. But I'm no expert on HTML or browser engines ... so, who knows. I'm just glad to have a convenient workaround. Link to comment Share on other sites More sharing options...
qwert Posted March 6, 2015 Author Share Posted March 6, 2015 Just a quick footnote ... In Win7, you can highlight snippet without the last character and drag/drop it into SciTE. For me, that's easier than cut and paste. I've tried a dozen other variations and this is the only one that works. I'll bet a "snippet washer" could be fashioned to duplicate whatever omitting the last character does with the html. Hmmm. Maybe something for a spare-time task. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now