Re: Copying text in boxes to clipboard
> JLG wrote: > Actually, you could extract the text and write it into an html table in any > version of LC. Then set the clipboardData["html"] to it. > > It would only paste into apps that accept html of course. Unfortunately no. The clipboardData["html"] is LC htmltext, which doesn't support . This is the same with fullClipboardData ["htmltext"] in LC 8 or later. What works with a object are in LC 8 or later both: the fullClipboardData ["html"] the rawClipboardData ["public.html"] ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Actually, you could extract the text and write it into an html table in any version of LC. Then set the clipboardData["html"] to it. It would only paste into apps that accept html of course. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On December 8, 2017 3:27:10 PM hh via use-livecodewrote: JLG wrote: In that case, others who have responded are right. You can't put that into the clipboard except as an image. The impact is (what I wrote): You can't put that into the **LC 6** - clipboard. Of course we can do that in LC 8 or later by accessing the *raw* clipboard. That is: Put the contents of the grid of simple text fields into a HTML object. Then write clean HTML data with that to the rawClipboardData, go to Pages, OpenOffice, Word or whatever and paste. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
> JLG wrote: > In that case, others who have responded are right. You > can't put that into the clipboard except as an image. The impact is (what I wrote): You can't put that into the **LC 6** - clipboard. Of course we can do that in LC 8 or later by accessing the *raw* clipboard. That is: Put the contents of the grid of simple text fields into a HTML object. Then write clean HTML data with that to the rawClipboardData, go to Pages, OpenOffice, Word or whatever and paste. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Jacque's suggestion for PDF printing is excellent. That will get you a file. But you mentioned you want this to end up on the clipboard for pasting into other programs. > Dunbarx wrote: > I did a quick test using the "import snapshot" command, and pasted the > result into another app. It seems to have the same resolution as the img in > the LC stack. You cannot improve that without a lot of doctoring, of course, > because that is the resolution of the source. Well, the relatively new ‘at size’ addition to snapshot might help here. Charles, try something like this: An area of your card holds the fields you want to copy. Put that rect of that area into variable myFieldRects Calculate the width of that rect and place it into variable myRectWidth Calculate the height of that rect and place it into variable myRectHeight Now here is where improving the resolution comes in. By using the ‘at size’ parameter you can essentially ‘enlarge' the image you capture. Just put amount of the enlargement you want into variable multiplier. Let’s say 10 times. So altogether we have: Put "20,100,700,150" into myFieldRects Put 680 into myRectWidth Put 50 into myRectHeight put 10 into multiplier put the windowID of this stack into winID export snapshot from rect(myFieldRects) of window winID at size (myRectWidth * multiplier),(myRectHeight * multiplier) to myimg as JPEG set clipboarddata["image"] to myimg Paste into, say, a Word doc. Now change multiplier to 1 - that will give you an ‘unbenlarged’ image. Now paste that into the same Word doc and look closely at the difference in resolution. You could try 'as PNG', too. Jim Lambert ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
But the OP wants everything in the clipboard, so he can paste away. I suppose that the target apps might have a feature to import pdf's as a menu command, but that would require scaling and who knows what else. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
On 12/8/17 12:30 PM, Charles Szasz via use-livecode wrote: Hi Jacque, I want to duplicate the borders of the fields in copying the fields to the clipboard. In that case, others who have responded are right. You can't put that into the clipboard except as an image. You could instead use the "print card" command to print to a PDF. That will render the text with real fonts that print and scale smoothly, and will also include the field borders. If you don't want to print the entire card, use the parameters that print only within a specified rectangle. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
"I want to duplicate the borders of the fields in copying the fields to the clipboard. " Right, so you need an image, not any sort of text wizardry. I did a quick test using the "import snapshot" command, and pasted the result into another app. It seems to have the same resolution as the img in the LC stack. You cannot improve that without a lot of doctoring, of course, because that is the resolution of the source. But not sharp enough? But then the stack itself also is not adequate? In other words, if the native LC rendering is not good enough, then I cannot see that you can use LC in the first place. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Hi Jacque, I want to duplicate the borders of the fields in copying the fields to the clipboard. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Looking at the responses so far, I think the confusion is whether you only want to extract the text from the fields, or whether you want to duplicate the field borders as well in order to reproduce the appearance of a grid with gridlines. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On December 8, 2017 8:53:35 AM Charles Szasz via use-livecodewrote: I have 14 fields for subtest names named test1, test2, test3,..test14 and another 14 fields for scores named score1, score2, score3,..score14. They are all associated with different tests. Some tests will have all 14 subtests and scores while others will have only have one subtest and one score. The test names and scores are all the same length. I greatly appreciate your willingness to help me. I have been dealing with this problem for a month or so. If you need more information, please let me know. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
David, I think your programming approach is a good idea and may be the solution to my problem. Do you have a sample stack you could send me to look at? Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
"This is why I was trying to utilize the clipboard using text directly rather than a graphic. " Not understanding (again). How would you reproduce the physical fields as any form of text? That is how I started, with the field data, which I see now was not what you wanted. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Hello Charles, I very often have to manipulate psychological test and subtest scores in LC that have to be exported in different formats. It is difficult to be sure I understand what you are trying to do, but I will say that I find the following the approach is one that suits me: • I store item numbers which contribute to sub scale scores in a custom property of a field that contains the sub scale score. Sometimes 2 properties if some items are reverse scored. Very easy then to step through any number of sub scale fields with a generic script which will populate each with the correct result. I like to use custom properties because they are easier to check and change than if they are buried in a script. • I write several ‘harvest' routines to gather the data from scored up test and subtest fields, and store the results as a tab delimited table in an ordinary LC field, in whatever format is required. (by ‘format’ I mean 1 case per line, or rows and columns for each case, not digital ‘formats’) The contents of that field can then be printed, copied to the clipboard or exported as a file. With only 14 fields, it will be very quick once you have gone through the drudgery of writing the ‘data harvest’ scripts. Am I on the right lines? Best wishes, David Glasgow > On 8 Dec 2017, at 2:51 pm, Charles Szasz via use-livecode >wrote: > > I have 14 fields for subtest names named test1, test2, test3,..test14 and > another 14 fields for scores named score1, score2, score3,..score14. They > are all associated with different tests. Some tests will have all 14 subtests > and scores while others will have only have one subtest and one score. The > test names and scores are all the same length. > > I greatly appreciate your willingness to help me. I have been dealing with > this problem for a month or so. If you need more information, please let me > know. > > Sent from my iPad > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Craig, I have tried the method you suggested. It does yield decent results but I was hoping for better quality. This is why I was trying to utilize the clipboard using text directly rather than a graphic. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Sorry, I meant "import snapshot". Try this, and read the dictionary to set it up the way you want, likely from a rect. The resulting img control can then be placed into the clipboard. Quality should be pretty good. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
I am only using export snapshot as a “last resort” due to the quality of the graphic it creates. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Dunbar, I tried using screenshots but they are graphic and lack the quality you would want. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
I have 14 fields for subtest names named test1, test2, test3,..test14 and another 14 fields for scores named score1, score2, score3,..score14. They are all associated with different tests. Some tests will have all 14 subtests and scores while others will have only have one subtest and one score. The test names and scores are all the same length. I greatly appreciate your willingness to help me. I have been dealing with this problem for a month or so. If you need more information, please let me know. Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Does the "export snapshot" command do what you want? That is an old gadget. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Ah. Hmmm. Do i understand you want to take a "picture" of your existing field array, and place that in the clipboard? -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Easy, if I understand what you are asking. So do you have pairs of fields, each pair a "name" and a "score"? Something like: name1, score1 name2, score2 etc. ?? Are these pairs of fields associated with each other in the way I assumed, that is, by their names, or in some other way? In any case, they have to be associated in some way or another, and you would write a repeat loop that examines each field pair, and collect their contents in a variable, with the accumulated data delimited in some manner. Then set the clipBoardData to that variable. If you explain just a little more what you actually have built, I can write an example handler to do what you want. I think. Whatever comes out of this, the version of LC is not an issue. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
There is no way to do that with the *LC 6* clipboard. But, assuming you are on Mac, you could ... ... (1) 'code' the fields into a html table (no need to display that in LC). This is not too hard when using merge. ... (2) Then write that to a temporary html file put myHTMLCode into url("file:///Users/admin/Desktop/tmp.html") ... (3) Then get shell("textutil -convert doc /Users/admin/Desktop/tmp.html). This generates a correct Word-file tmp.doc in the same folder. This file can be read in by Word or Pages or even TextEdit. (1)-(3) could go into one 'export to doc' script = one click. [TextEdit can also open directly the HTML file and then you could save as word document (use cmd+opt+shift S). With the same result, TextEdit uses internally textutil for that.] ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
Thanks for responding to my LC problem. The fields have their showBorder set to true. There are 14 test name fields and 14 score fields. The fields are coded to be visible when they have content. I am not using a dataGrid. How do code to these many fields to the clipboard? Sent from my iPad ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Copying text in boxes to clipboard
A table made up of boxes? Are thee boxes individual fields? Or are they the "cells" that comprise table fields or dataGrids? In either case, or in any case at all, one can place the data in those boxes onto the clipboard by setting the clipbardData to the text of those, er, boxes. This either all at once in one line, if a table field or DG, or in a handful of lines under script control if disparate containers. But what do you have going here? Craig Newman -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode