Re: Saving a tab formatted field to a file and retaining its formatting

2019-04-19 Thread Robert J. Earp via use-livecode
Dear Håkan,
Please accept my apologies at not replying to you before, and many thanks for 
contacting me and the suggestion.  For our current use we can manually set the 
tab positions in a field, and now that we have learnt to combine "open printing 
to pdf" and “ evPrintField" we can easily output formatted .pdf docs.  Why this 
is not identified in the dictionary I don’t know, but like a lot of things in 
LC, and all of its predecessors, the dictionary leaves a lot to be desired and 
really you have to use it a lot to get proficient, to use the expertise of the 
user lists !!

Again, many thanks for the help, I hope I can reciprocate at some time.

Kind regards, Bob...



> On Apr 11, 2019, at 07:01, ha...@exformedia.se wrote:
> 
> If you want the tab stops to be included in the file I guess you need to add 
> them manually to the rtf file. There is a \tx command in rtf that sets the 
> tab size. I used it long time ago so I don’t remember of it was relative or 
> absolut positions but I do think it should be doable…
> 
> :-Håkan
> On 8 Apr 2019, 18:25 +0200, Robert J. Earp via use-livecode 
> , wrote:
>> Thanks for the reply Paul. Yes, tried that but there are problems. It saves 
>> a .rtf file but when you open that in MSWord (OS X or Windows) the tabs are 
>> changed to underscores. If you open the file in OS X TextEdit it does have 
>> tabs but the position/spacing is not retained. I’ve created a sample/test 
>> stack if anybody wants to play ;-)
>> 
>> Our project is supposed to create a formatted file that external to the LC 
>> project, gets assembled with other documents/files to make a presentable 
>> report. The other docs/files are .rtf (created in MSWord or Pages or 
>> TextEdit) and an .eps file. The final report will be a .pdf and Acrobat is 
>> likely what will get used to manually assemble the final report.
>> 
>> To quote my valued colleague (RogerG) on this problem, and who has spent 
>> inordinate hours trying to find a solution, tabs have turned out to be 
>> tricky little devils in LC !!
>> 
>> best, Bob...
>> 
>>> From: Paul Dupuis mailto:p...@researchware.com>>
>>> To: use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
>>> Subject: Re: Saving a tab formatted field to a file and retaining its
>>> formatting
>>> Message-ID: >> <mailto:ce0de0c4-5daa-22c0-bf46-cfeceb79a...@researchware.com>>
>>> Content-Type: text/plain; charset=utf-8; format=flowed
>>> 
>>> I take it your have tried:
>>> 
>>> put the rtfText of field "X" into URL
>>> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>>> 
>>> And then reading it back to a new field with:
>>> 
>>> set the rtfText of field "Y" to URL
>>> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>>> 
>>> and the tab spacing is not preserved?
>>> 
>>> 
>>> 
>>> On 4/7/2019 7:57 PM, Robert J. Earp via use-livecode wrote:
>>>> Dear all, we have a field that is formatted nicely with tabs and want to 
>>>> save that as a file, retaining the tab formatting. The saved file format 
>>>> ideally should be .rtf but we may be able to use other formats such as .pdf
>>>> 
>>>> Anybody got any ideas how to do this ?
>>>> 
>>>> Thanks in advance for your suggestions.
>>>> 
>>>> best, Bob?
>>>> 
>>>> Bob Earp - White Rock, BC, Canada
>> ___
>> 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: Saving a tab formatted field to a file and retaining its formatting

2019-04-15 Thread Bob Sneidar via use-livecode
Why? I already have that for Mac via Applescript and Javascript. You can also 
populate a .fdf file if it's properly formatted, and the PDF is configured to 
access it upon opening. Also there is the qrtPDFLib. 

Bob S


> On Apr 9, 2019, at 09:00 , Robert J. Earp via use-livecode 
>  wrote:
> 
> RogerG and I are currently mousing around creating a LC tool to output a 
> fields content to .pdfIt’s looking promising and we’ll let you know of 
> our success or not !!
> 
> best, Bob…
> 
> Bob Earp - White Rock, BC

___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-11 Thread Håkan Liljegren via use-livecode
If you want the tab stops to be included in the file I guess you need to add 
them manually to the rtf file. There is a \tx command in rtf that sets the tab 
size. I used it long time ago so I don’t remember of it was relative or absolut 
positions but I do think it should be doable…

:-Håkan
On 8 Apr 2019, 18:25 +0200, Robert J. Earp via use-livecode 
, wrote:
> Thanks for the reply Paul. Yes, tried that but there are problems. It saves a 
> .rtf file but when you open that in MSWord (OS X or Windows) the tabs are 
> changed to underscores. If you open the file in OS X TextEdit it does have 
> tabs but the position/spacing is not retained. I’ve created a sample/test 
> stack if anybody wants to play ;-)
>
> Our project is supposed to create a formatted file that external to the LC 
> project, gets assembled with other documents/files to make a presentable 
> report. The other docs/files are .rtf (created in MSWord or Pages or 
> TextEdit) and an .eps file. The final report will be a .pdf and Acrobat is 
> likely what will get used to manually assemble the final report.
>
> To quote my valued colleague (RogerG) on this problem, and who has spent 
> inordinate hours trying to find a solution, tabs have turned out to be tricky 
> little devils in LC !!
>
> best, Bob...
>
> > From: Paul Dupuis mailto:p...@researchware.com>>
> > To: use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
> > Subject: Re: Saving a tab formatted field to a file and retaining its
> > formatting
> > Message-ID:  > <mailto:ce0de0c4-5daa-22c0-bf46-cfeceb79a...@researchware.com>>
> > Content-Type: text/plain; charset=utf-8; format=flowed
> >
> > I take it your have tried:
> >
> > put the rtfText of field "X" into URL
> > ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
> >
> > And then reading it back to a new field with:
> >
> > set the rtfText of field "Y" to URL
> > ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
> >
> > and the tab spacing is not preserved?
> >
> >
> >
> > On 4/7/2019 7:57 PM, Robert J. Earp via use-livecode wrote:
> > > Dear all, we have a field that is formatted nicely with tabs and want to 
> > > save that as a file, retaining the tab formatting. The saved file format 
> > > ideally should be .rtf but we may be able to use other formats such as 
> > > .pdf
> > >
> > > Anybody got any ideas how to do this ?
> > >
> > > Thanks in advance for your suggestions.
> > >
> > > best, Bob?
> > >
> > > Bob Earp - White Rock, BC, Canada
> ___
> 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: Saving a tab formatted field to a file and retaining its formatting

2019-04-11 Thread Eller, Roger via use-livecode
Have you tried revPrintField? It's an oldie but goodie.



From: use-livecode  on behalf of Robert 
J. Earp via use-livecode 
Sent: Monday, April 8, 2019 12:24 PM
To: use-livecode@lists.runrev.com
Cc: Robert J. Earp
Subject: Re: Saving a tab formatted field to a file and retaining its formatting

Thanks for the reply Paul.  Yes, tried that but there are problems.  It saves a 
.rtf file but when you open that in MSWord (OS X or Windows) the tabs are 
changed to underscores.  If you open the file in OS X TextEdit it does have 
tabs but the position/spacing is not retained.  I’ve created a sample/test 
stack if anybody wants to play ;-)

Our project is supposed to create a formatted file that external to the LC 
project, gets assembled with other documents/files to make a presentable 
report.  The other docs/files are .rtf (created in MSWord or Pages or TextEdit) 
and an .eps file.  The final report will be a .pdf and Acrobat is likely what 
will get used to manually assemble the final report.

To quote my valued colleague (RogerG) on this problem, and who has spent 
inordinate hours trying to find a solution, tabs have turned out to be tricky 
little devils in LC !!

best, Bob...

> From: Paul Dupuis mailto:p...@researchware.com>>
> To: use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
> Subject: Re: Saving a tab formatted field to a file and retaining its
>   formatting
> Message-ID:  <mailto:ce0de0c4-5daa-22c0-bf46-cfeceb79a...@researchware.com>>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> I take it your have tried:
>
> put the rtfText of field "X" into URL
> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>
> And then reading it back to a new field with:
>
> set the rtfText of field "Y" to URL
> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>
> and the tab spacing is not preserved?
>
>
>
> On 4/7/2019 7:57 PM, Robert J. Earp via use-livecode wrote:
>> Dear all, we have a field that is formatted nicely with tabs and want to 
>> save that as a file, retaining the tab formatting.  The saved file format 
>> ideally should be .rtf but we may be able to use other formats such as .pdf
>>
>> Anybody got any ideas how to do this ?
>>
>> Thanks in advance for your suggestions.
>>
>> best, Bob?
>>
>> Bob Earp - White Rock, BC, Canada

___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-10 Thread Richard Gaskin via use-livecode

Robert J. Earp wrote:

> Many thanks Paul and to Ron Metzker who kindly contacted me off-list
> with a comprehensive handler of what he does using revPrintField.
> I must admit that the Dictionary still leaves a lot to be desired and
> without the valued members of this and other lists LC would not be so
> successful ;-)

I find communities invaluable for everything I learn.

What could we do with the Dictionary to make it more useful in this case?


> We will need a cross platform (OS X / Windows) solution for our
> project and although things seem to work great to both print and
> save a .pdf using revPrintField, I’m not sure if Windows supports
> a print to .pdf feature.

The Dictionary describes the PDF print option as being available on 
macOS, Windows, Linux, and iOS.  I've used it on everything but iOS - 
works like a champ.



> As with Ron, I too am OS X based so I can’t check it

A $80 copy of Windows and this fine VM will change your life:

https://www.virtualbox.org/

Free, open source, fast, simple and flexible: best VM I've ever used 
(thanks to Mark Wieder for getting me to try it).


You'll be able to share folders with the PC instance, as well as 
Clipboard contents, networking, and more.  Sometimes installing on metal 
is necessary, but for most day-to-day stuff a good VM inside the OS of 
your choice is a developer's workflow dream come true.



> but I’m led to believe that Windows 10 supports such, but does anybody
> know if previous versions of Windows does ?

It's not dependent on OS PDF drivers, so it should work on any supported 
Windows version.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: Saving a tab formatted field to a file and retaining its formatting

2019-04-10 Thread Richard Gaskin via use-livecode

Robert J. Earp wrote:

> Richard wrote:
>> > Would LC's built-in print to PDF support not be an option?
>
> Richard, many thanks for the thought.  If you mean the built-in
> “printing to pdf” then yes, but as far as I could see it only prints
> cards, not just field content.  Is there other pdf support ?

All printing in LC is based on a card, but has some very flexible 
options like printing a header into one rect, a footer into another, and 
the body into the middle before closing the page.  Coupled with the 
nifty metrics we can get for field rendering, even styled text can be 
printed quite nicely.


But all that can be tedious work.  Nice if you have specialized needs, 
but if you have a field ready to go the folks at LC have already done 
the work for you:  see the revPrintField command.


LC's PDF generator will take any output LC can produce, so using that in 
conjunction with revPrintField may be just what you're looking for.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: Saving a tab formatted field to a file and retaining its formatting

2019-04-10 Thread Robert J. Earp via use-livecode
Many thanks Paul and to Ron Metzker who kindly contacted me off-list with a 
comprehensive handler of what he does using revPrintField.   I must admit that 
the Dictionary still leaves a lot to be desired and without the valued members 
of this and other lists LC would not be so successful ;-)

We will need a cross platform (OS X / Windows) solution for our project and 
although things seem to work great to both print and save a .pdf using 
revPrintField, I’m not sure if Windows supports a print to .pdf feature.  As 
with Ron, I too am OS X based so I can’t check it, but I’m led to believe that 
Windows 10 supports such, but does anybody know if previous versions of Windows 
does ?

Thanks, Bob…
White Rock, BC

> Date: Wed, 10 Apr 2019 13:23:50 -0400
> From: Paul Dupuis mailto:p...@researchware.com>>
> To: use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
> Subject: Re: Saving a tab formatted field to a file and retaining its
>   formatting
> 
> Look at "revPrintField" in the Dictionary. If I recall, I think this can 
> be used with the open printing to pdf command
___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-10 Thread Paul Dupuis via use-livecode
Look at "revPrintField" in the Dictionary. If I recall, I think this can 
be used with the open printing to pdf command




On 4/10/2019 12:46 PM, Robert J. Earp via use-livecode wrote:

Richard, many thanks for the thought.  If you mean the built-in “printing to 
pdf” then yes, but as far as I could see it only prints cards, not just field 
content.  Is there other pdf support ?

So, we’re having to mess around with creating a series of cards with a single 
field on each with their rects set to US Letter size, copying the desired field 
content into these and then printing to a pdf file.  With the current project 
where the field to print remains roughly the same character count it’s not a 
biggy to get pagination right, but I was hoping to build a tool that could take 
any size of field content with whatever tabs and output that automatically to a 
.pdf of letter size that may be one or more pages.

I haven’t got into controlling fonts yet, meaning does the “printing to pdf” 
use the font attributes that are displayed in the field on the card or ?  My 
simple test suggests yes.

best, Bob...





Subject: Re: Saving a tab formatted field to a file and retaining its
formatting

Robert J. Earp wrote:


I?m not sure if the HTMLText solution will work for us as by default
the output file would open in a browser and we need to get it into
.pdf format to assemble (in Acrobat) with the other parts of the
report.

RogerG and I are currently mousing around creating a LC tool to output
a fields content to .pdfIt?s looking promising and we?ll let you
know of our success or not !!

Would LC's built-in print to PDF support not be an option?

--
  Richard Gaskin
  Fourth World Systems

___
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: Re: Saving a tab formatted field to a file and retaining its formatting

2019-04-10 Thread Robert J. Earp via use-livecode
Richard, many thanks for the thought.  If you mean the built-in “printing to 
pdf” then yes, but as far as I could see it only prints cards, not just field 
content.  Is there other pdf support ?

So, we’re having to mess around with creating a series of cards with a single 
field on each with their rects set to US Letter size, copying the desired field 
content into these and then printing to a pdf file.  With the current project 
where the field to print remains roughly the same character count it’s not a 
biggy to get pagination right, but I was hoping to build a tool that could take 
any size of field content with whatever tabs and output that automatically to a 
.pdf of letter size that may be one or more pages.

I haven’t got into controlling fonts yet, meaning does the “printing to pdf” 
use the font attributes that are displayed in the field on the card or ?  My 
simple test suggests yes.

best, Bob... 




> Subject: Re: Saving a tab formatted field to a file and retaining its
>   formatting
> 
> Robert J. Earp wrote:
> 
>> I?m not sure if the HTMLText solution will work for us as by default
>> the output file would open in a browser and we need to get it into
>> .pdf format to assemble (in Acrobat) with the other parts of the
>> report.
>> 
>> RogerG and I are currently mousing around creating a LC tool to output
>> a fields content to .pdfIt?s looking promising and we?ll let you
>> know of our success or not !!
> 
> Would LC's built-in print to PDF support not be an option?
> 
> -- 
>  Richard Gaskin
>  Fourth World Systems

___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-09 Thread Richard Gaskin via use-livecode

Robert J. Earp wrote:

> I’m not sure if the HTMLText solution will work for us as by default
> the output file would open in a browser and we need to get it into
> .pdf format to assemble (in Acrobat) with the other parts of the
> report.
>
> RogerG and I are currently mousing around creating a LC tool to output
> a fields content to .pdfIt’s looking promising and we’ll let you
> know of our success or not !!

Would LC's built-in print to PDF support not be an option?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: Saving a tab formatted field to a file and retaining its formatting

2019-04-09 Thread Robert J. Earp via use-livecode
Many thanks for all of the great response and from such experts !!

I’m not sure if the HTMLText solution will work for us as by default the output 
file would open in a browser and we need to get it into .pdf format to assemble 
(in Acrobat) with the other parts of the report.

RogerG and I are currently mousing around creating a LC tool to output a fields 
content to .pdfIt’s looking promising and we’ll let you know of our success 
or not !!

best, Bob…

Bob Earp - White Rock, BC


> Our project is supposed to create a formatted file that external to the LC 
> project, gets assembled with other documents/files to make a presentable 
> report.  The other docs/files are .rtf (created in MSWord or Pages or 
> TextEdit) and an .eps file.  The final report will be a .pdf and Acrobat is 
> likely what will get used to manually assemble the final report.

___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Mark Waddingham via use-livecode

On 2019-04-08 18:27, Ralph DiMola via use-livecode wrote:
No tabstops using the styledText property either. This is the one I 
would

have expected to include the tab stops/widths.


Both styledText and htmlText representations do include the tabStops 
(and tabAlign) settings - however both those formats (by default) only 
encode the field content (e.g. paragraph styles, character styles and 
text).


If you want the properties inherited into the field content (i.e. from 
all ancestor objects, including the field itself) then you can use the 
'effective' adjective.


In contrast, rtfText is always generated as if 'effective' is specified 
(as you can't encode the notion of inheritance of property values in 
RTF) - however, as has been noticed, it does not support the tabStops 
nor tabAlign properties).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Bob Sneidar via use-livecode
This is a bit more useful. Pass the long id of the field object:

function fieldToHTMLTable pFieldID
   if not there is a field pFieldID then return "ERROR: Field object does not 
exist!"
   put the htmltext of pFieldID into ht
   put the effective textSize of pFieldID into fs
   put the tabstops of pFieldID into tStops
   put the width of pFieldID into fw
   put empty into tabbs
   -- we need tabstops relative, not absolute
   put item 1 of tStops into tabbs[1]
   repeat with i=2 to the num of items of tStops
  put item i of tStops - item (i-1) of tStops into tabbs[i]
   end repeat
   set itemdel to ("&" & "#9;");
   set linedel to ""
   replace "" with empty in ht
   put ""into s0
   repeat for each line L in ht
  put empty into s
  repeat with i=1 to the num of items of L
 put item i of L into II
 put "" &II& "" after s
  end repeat
  if s is not empty then put cr&""&s&"" after s0
   end repeat
   put "" & cr & \
 "" & \
 s0 & cr & "" into htm
   return htm
end fieldToHTMLTable

Bob S

> On Apr 8, 2019, at 09:07 , hh via use-livecode 
>  wrote:
> 
> -- Converts a simple table field with tabstops to a html 
> http://lists.runrev.com/pipermail/use-livecode/2019-March/253271.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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Ralph DiMola via use-livecode
No tabstops using the styledText property either. This is the one I would
have expected to include the tab stops/widths.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Richard Gaskin via use-livecode
Sent: Monday, April 08, 2019 11:56 AM
To: use-livecode@lists.runrev.com
Cc: Richard Gaskin
Subject: Re: Saving a tab formatted field to a file and retaining its
formatting

Robert J. Earp wrote:

 > Dear all, we have a field that is formatted nicely with tabs and want  >
to save that as a file, retaining the tab formatting.  The saved file  >
format ideally should be .rtf but we may be able to use other formats  >
such as .pdf  >  > Anybody got any ideas how to do this ?

Short answer: Not directly just yet, but with RTF being a text format you
could write a function to add column widths to RTF on export.


Longer answer:

Exporting the contents of a field does not export the properties of a 
field object itself.  But with the enhancements of v5.4 we now have MANY 
more paragraph-level properties.

So we would expect that setting the tabStops (or the newer tabWidths, 
sometimes a more useful alternative) of each line within the field would 
produce rtFText that includes those column specifiers.

But alas, I just tried it and it does not.

If someone has time to catalog those RTF features that LC now supports 
with fields but does not include in rtfText it may be helpful to file an 
enhancement request to bring rtfText current with the full range of 
relevant text properties.

RtfText is not designed to be able to reproduce an LC field with 
complete fidelity (that's htmlText's role), but should include all 
attributes common to both LC and RTF, and AFAIK did cover almost all of 
them until v5.4 introduced all the new paragraph and inline styling 
properties.

For now, a workaround would be to write a function that walks through 
the rows and columns of a field, including column width specifiers as 
you go.   Tedious, but doable.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.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


___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Robert J. Earp via use-livecode
Thanks for the reply Paul.  Yes, tried that but there are problems.  It saves a 
.rtf file but when you open that in MSWord (OS X or Windows) the tabs are 
changed to underscores.  If you open the file in OS X TextEdit it does have 
tabs but the position/spacing is not retained.  I’ve created a sample/test 
stack if anybody wants to play ;-)

Our project is supposed to create a formatted file that external to the LC 
project, gets assembled with other documents/files to make a presentable 
report.  The other docs/files are .rtf (created in MSWord or Pages or TextEdit) 
and an .eps file.  The final report will be a .pdf and Acrobat is likely what 
will get used to manually assemble the final report.

To quote my valued colleague (RogerG) on this problem, and who has spent 
inordinate hours trying to find a solution, tabs have turned out to be tricky 
little devils in LC !!

best, Bob... 

> From: Paul Dupuis mailto:p...@researchware.com>>
> To: use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
> Subject: Re: Saving a tab formatted field to a file and retaining its
>   formatting
> Message-ID:  <mailto:ce0de0c4-5daa-22c0-bf46-cfeceb79a...@researchware.com>>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> I take it your have tried:
> 
> put the rtfText of field "X" into URL 
> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
> 
> And then reading it back to a new field with:
> 
> set the rtfText of field "Y" to URL 
> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
> 
> and the tab spacing is not preserved?
> 
> 
> 
> On 4/7/2019 7:57 PM, Robert J. Earp via use-livecode wrote:
>> Dear all, we have a field that is formatted nicely with tabs and want to 
>> save that as a file, retaining the tab formatting.  The saved file format 
>> ideally should be .rtf but we may be able to use other formats such as .pdf
>> 
>> Anybody got any ideas how to do this ?
>> 
>> Thanks in advance for your suggestions.
>> 
>> best, Bob?
>> 
>> Bob Earp - White Rock, BC, Canada
___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread hh via use-livecode
-- Converts a simple table field with tabstops to a html 
http://lists.runrev.com/pipermail/use-livecode/2019-March/253271.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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Richard Gaskin via use-livecode

Robert J. Earp wrote:

> Dear all, we have a field that is formatted nicely with tabs and want
> to save that as a file, retaining the tab formatting.  The saved file
> format ideally should be .rtf but we may be able to use other formats
> such as .pdf
>
> Anybody got any ideas how to do this ?

Short answer: Not directly just yet, but with RTF being a text format 
you could write a function to add column widths to RTF on export.



Longer answer:

Exporting the contents of a field does not export the properties of a 
field object itself.  But with the enhancements of v5.4 we now have MANY 
more paragraph-level properties.


So we would expect that setting the tabStops (or the newer tabWidths, 
sometimes a more useful alternative) of each line within the field would 
produce rtFText that includes those column specifiers.


But alas, I just tried it and it does not.

If someone has time to catalog those RTF features that LC now supports 
with fields but does not include in rtfText it may be helpful to file an 
enhancement request to bring rtfText current with the full range of 
relevant text properties.


RtfText is not designed to be able to reproduce an LC field with 
complete fidelity (that's htmlText's role), but should include all 
attributes common to both LC and RTF, and AFAIK did cover almost all of 
them until v5.4 introduced all the new paragraph and inline styling 
properties.


For now, a workaround would be to write a function that walks through 
the rows and columns of a field, including column width specifiers as 
you go.   Tedious, but doable.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Bob Sneidar via use-livecode
I just tested with htmltext. Tab stops are NOT preserved. 

Bob S


> On Apr 8, 2019, at 07:55 , Paul Dupuis via use-livecode 
>  wrote:
> 
> On 4/7/2019 9:00 PM, Paul Dupuis via use-livecode wrote:
>> I take it your have tried:
>> 
>> put the rtfText of field "X" into URL 
>> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>> 
>> And then reading it back to a new field with:
>> 
>> set the rtfText of field "Y" to URL 
>> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>> 
>> and the tab spacing is not preserved?
>> 
> 
> If the rtfText does nto preserve the tabstops, the htmlText should preserve 
> the tabstops. See the dictionary entry for the htmlText property of a field.


___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Bob Sneidar via use-livecode
Because the tab stops are not part of the data of any formatted text 
properties. You can test this by creating a table field, setting the tab stops 
to whatever you want, typing some information, setting the clipBoardData 
["rtftext"] to the rtftext of the table field, then pasting into a word 
document as formatted text. Word retains it's own tab stops, because none of 
the tab stops set in the table field are in the rtf text copied to the 
clipboard. 

Bob S


> On Apr 8, 2019, at 06:25 , dunbarxx via use-livecode 
>  wrote:
> 
> Hi.
> 
> I am always missing something. Why is there an issue retaining tabs in a
> body of ordinary text?


___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Paul Dupuis via use-livecode

On 4/7/2019 9:00 PM, Paul Dupuis via use-livecode wrote:

I take it your have tried:

put the rtfText of field "X" into URL 
("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")


And then reading it back to a new field with:

set the rtfText of field "Y" to URL 
("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")


and the tab spacing is not preserved?



If the rtfText does nto preserve the tabstops, the htmlText should 
preserve the tabstops. See the dictionary entry for the htmlText 
property of a field.


If neither the rtfText property of a field, nor the htmlText property of 
a field preserve the tabstops (again, not sure about rtfText, but the 
Dictionary implies htmlText does), you can use


put the arralEncode(the styledText of field "X") into URL 
("binfile:"&specialFolderPath("desktop")&slash&"savedfield.bin")


And then reading it back to a new field with:

put URL 
("binfile:"&specialFolderPath("desktop")&slash&"savedfield.bin")into 
tFieldData

set the styledText of field "Y" to arrayDecode(tFieldData)

But this later approach does not produce an RTF or HTML file that can be 
opened in other software tools like Microsoft Word


___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread dunbarxx via use-livecode
I am usually very good at describing problems.

I am not so good at describing solutions.

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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Roger Guay via use-livecode
That is a very clear explanation of what I think the problem is.

Roger

> On Apr 8, 2019, at 7:03 AM, dunbarxx via use-livecode 
>  wrote:
> 
> But that is a property of a field, not of text, and I do not think such
> information can be similarly "transmitted", regardless of how that text is
> formatted.

___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread dunbarxx via use-livecode
Aha. TabStops.

Unless I am missing something, is it that the data in a tabStop formatted
field is to be copied somehow, so that if loaded into a brand new field, the
tabStops property is also "loaded" into that field?


But that is a property of a field, not of text, and I do not think such
information can be similarly "transmitted", regardless of how that text is
formatted.

I could be wrong.

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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread Brian Milby via use-livecode
I don’t think it is the tab character but rather the tab stops that are the 
problem.

Brian
On Apr 8, 2019, 9:26 AM -0400, dunbarxx via use-livecode 
, wrote:
> Hi.
>
> I am always missing something. Why is there an issue retaining tabs in a
> body of ordinary text?
>
> I have a table field with "A" & tab & "B" & tab & "C" in it. If I write that
> text into a file on my desktop and then load it back into the second line of
> that field:
>
> on mouseUp
> get fld 1
>
> open file "/users/craignewman/desktop/xxx" for text write
> write it to file "/users/craignewman/desktop/xxx"
> close file "/users/craignewman/desktop/xxx"
>
> open file "/users/craignewman/desktop/xxx" for read
> read from file "/users/craignewman/desktop/xxx" until EOF
> close file "/users/craignewman/desktop/xxx"
>
> put it into line 2 of fld 1
> end mouseUp
>
> The identical text is now in line 2, all tabs intact. No rtf stuff needed.
>
> I am always missing something.
>
> 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
___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-08 Thread dunbarxx via use-livecode
Hi.

I am always missing something. Why is there an issue retaining tabs in a
body of ordinary text?

I have a table field with "A" & tab & "B" & tab & "C" in it. If I write that
text into a file on my desktop and then load it back into the second line of
that field:

on mouseUp
   get fld 1
   
   open file  "/users/craignewman/desktop/xxx" for text write
   write it to file  "/users/craignewman/desktop/xxx"
   close file "/users/craignewman/desktop/xxx"
   
   open file  "/users/craignewman/desktop/xxx" for read
   read from file  "/users/craignewman/desktop/xxx" until EOF
   close file  "/users/craignewman/desktop/xxx"
   
   put it into line 2 of fld 1
end mouseUp

The identical text is now in line 2, all tabs intact. No rtf stuff needed.

I am always missing something.

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


Re: Saving a tab formatted field to a file and retaining its formatting

2019-04-07 Thread Paul Dupuis via use-livecode

I take it your have tried:

put the rtfText of field "X" into URL 
("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")


And then reading it back to a new field with:

set the rtfText of field "Y" to URL 
("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")


and the tab spacing is not preserved?



On 4/7/2019 7:57 PM, Robert J. Earp via use-livecode wrote:

Dear all, we have a field that is formatted nicely with tabs and want to save 
that as a file, retaining the tab formatting.  The saved file format ideally 
should be .rtf but we may be able to use other formats such as .pdf

Anybody got any ideas how to do this ?

Thanks in advance for your suggestions.

best, Bob…

Bob Earp - White Rock, BC, Canada
___
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: Saving a tab formatted field to a file and retaining its formatting

2019-04-07 Thread Roger Guay via use-livecode
I sent a similar message some time ago to no avail. Let’s see if you are more 
successful. 

R

> On Apr 7, 2019, at 4:57 PM, Robert J. Earp via use-livecode 
>  wrote:
> 
> Dear all, we have a field that is formatted nicely with tabs and want to save 
> that as a file, retaining the tab formatting.  The saved file format ideally 
> should be .rtf but we may be able to use other formats such as .pdf
> 
> Anybody got any ideas how to do this ?
> 
> Thanks in advance for your suggestions.
> 
> best, Bob…
> 
> Bob Earp - White Rock, BC, Canada
> ___
> 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