ggg Posted September 20, 2005 Posted September 20, 2005 If we select the 2x2 table near the bottom ofhttp://www.autoitscript.com/code/and press ctrl-c to copy it to the clipboard and run the AutoIt program:$x = ClipGet()MsgBox(0,"",$x)then adjacent cells in a row are all run together.However, if we paste that same clipboardinto Excel then the table cells appear insimilarly arranged cells in the Excelspreadsheet. Excel knew how to distinguish the individual cells.How do I do that in AutoIt? That ishow does one read in the clipboard inthis example so that one can stilldistinguish which text goes in whichcell like Excel can do?Is it possible in AutoIt? (Note that I am not looking for a solutionbased on parsing the original HTMLfile. I know how to do that usingthe InternetExplorer.Application COMobject but that's not what I am asking. What Idon't know is how to distinguish the cellsin the clipboard. The info must be theresince Excel can do it. But it does notseem to appear in AutoIt.)Note that if I paste it into Excel and thencopy it back from Excel and run theabove AutoIt program then I candistinguish it since Excel puts tabsbetween cells in a row but I want todo this entirely programmaticallyand not involve Excel at all. I guessI would settle for a free utility thatinserts tabs into the clipboard providedits automatic although a solution entirely in AutoIt Scripting Languagewould be even better.
trids Posted September 20, 2005 Posted September 20, 2005 I don't believe it's as simple as that. There is more to the clipboard than meets the eye: download an open source application called CLCL.exe (http://www.nakka.com) .. Besides keeping a history of your clipboard, it displays all the details about what's currently in it. Copy your HTML table, and see what CLCL reveals .. I think you'll be surprised, if not fascinated Given that what you paste into Excel preserves the font characteristics of the HTML, I'd say that Excel doesn't just interpret the "Text" portion of the clipboard, but perhaps something like the clipboard's Rich Text Format object.There have been incentives in the past to get the AU3 ClipGet() function to provide more than just the text that might be on the clipboard. If CLCL can do it (source readily available), then it should be possible to harvest such delights as images, file-lists, and even RTF for you, too. Maybe this is an opportunity to revisit the question. Devs?HTH
ggg Posted September 20, 2005 Author Posted September 20, 2005 Yes, I think something along those lines is what I am asking about and would be nice to have in AutoIt.
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