[comp.sys.mac.hypercard] Exporting styled text from HC 2.0

tisue@tartarus.uchicago.edu (Seth Tisue) (10/18/90)

I've been working with HyperCard 2.0 for about two weeks now and have had NO
major problems with it and very few minor ones...  I'm impressed.  I have a
question which if answered would make one of the 2.0 enhancements more useful
if there's an answer.  Is there any way to import and/or export styled text
(i.e., text with boldface, italics, etc.) in and out of HC?  For example, I'd
like to be able to type a letter into a field and then save it to a word-
processor-readable file without losing all the character formatting info.  Is
this possible?

ollef@sics.se (Olle Furberg) (10/18/90)

In <1990Oct18.030722.21087@midway.uchicago.edu> tisue@tartarus.uchicago.edu (Seth Tisue) writes:

>if there's an answer.  Is there any way to import and/or export styled text
>(i.e., text with boldface, italics, etc.) in and out of HC?  For example, I'd

  HC 2.0 exports styled text by giving the style information in a scrap data
type called 'styl'. This is the official interchange format for formatted text
on the Macintosh, but I haven't seen any program (except HC) that obeys to
these guidelines.

  It would be great if someone could make a Clipboard magician tool for 
converting different style-information to/from the 'styl' format.

athos@apple.com (Rick Eames) (10/18/90)

Well, I am glad you asked!  I have been working on an XCMD to do exactly 
what you want.  The external will use Claris XTND technology, and should 
be out in a few weeks.  This is not an Apple Project, this is just a "me" 
project, so I am not sure if it will be Shareware or not.  Let me know if 
you're interested.  It'll allow you to both read and write styled info.

###########################
Athos
"Not Apple's Opinions....blah...blah....blah"

leonardr@svc.portal.com (Leonard Rosenthol) (10/19/90)

In article <1990Oct18.030722.21087@midway.uchicago.edu>,
tisue@tartarus.uchicago.edu (Seth Tisue) writes:
> Is there any way to import and/or export styled text (i.e., text with 
> boldface, italics, etc.) in and out of HC?  For example, I'd like to be 
> able to type a letter into a field and then save it to a word-processor-
> readable file without losing all the character formatting info.  
> Is this possible?

	From raw Hypertalk, no, this is not possible - however one of the
new HC 2.0 XCMD callbacks (GetFieldTE) will allow an XCMD to get the full
stylized contents of a field, and then do what it wants with it.  So if there
is some enterprising individual out there who wants to write the HC->MacWrite
(or whatever) XCMD, it is not difficult...
--
Leonard Rosenthol
Software Ventures Corp.
MicroPhone II Development Team

gandalf@apple.com (Martin Gannholm) (10/19/90)

In article <1990Oct18.030722.21087@midway.uchicago.edu> 
tisue@tartarus.uchicago.edu (Seth Tisue) writes:
> Is there any way to import and/or export styled text
> (i.e., text with boldface, italics, etc.) in and out of HC?  For 
example, I'd
> like to be able to type a letter into a field and then save it to a word-
> processor-readable file without losing all the character formatting info.

There is no built-in way to do it directly from HyperTalk, but there is an 
XCMD callback that will return a styled TextEdit handle with the styled 
text in it. Using this one could write and XCMD that saved into any format.

As there are people working on doing this, keep your eyes and ears peeled 
for the shareware or commercial XCMDs...

Martin Gannholm
Apple Computer

Exclaimer!!!   I typed this myself = I speak for myself...

gilbertd@silver.ucs.indiana.edu (Don Gilbert) (10/19/90)

In article <1990Oct18.142957.4954@sics.se> ollef@sics.se (Olle Furberg) writes:
>In <1990Oct18.030722.21087@midway.uchicago.edu> tisue@tartarus.uchicago.edu (Seth Tisue) writes:
>
>>if there's an answer.  Is there any way to import and/or export styled text
>>(i.e., text with boldface, italics, etc.) in and out of HC?  For example, I'd
>
>  HC 2.0 exports styled text by giving the style information in a scrap data
>type called 'styl'. This is the official interchange format for formatted text
>on the Macintosh, but I haven't seen any program (except HC) that obeys to
>these guidelines.
>

MacDraw II supports 'styl' text. Canvas 2 supports it.  I beleive MacWrite II does, but don't
have a copy of that here.  And a few of my own programs use it. It is
quite easy to program, as TextEdit does the work.

-- Don
A

Don.Gilbert@Iubio.Bio.Indiana.Edu
biocomputing office, indiana univ., bloomington, in 47405, usa

ollef@sics.se (Olle Furberg) (10/19/90)

In <65598@iuvax.cs.indiana.edu> gilbertd@silver.ucs.indiana.edu (Don Gilbert) writes:

>In article <1990Oct18.142957.4954@sics.se> ollef@sics.se (Olle Furberg) writes

>>  HC 2.0 exports styled text by giving the style information in a scrap data
>>type called 'styl'. This is the official interchange format for formatted tex
>>on the Macintosh, but I haven't seen any program (except HC) that obeys to
>>these guidelines.

>MacDraw II supports 'styl' text. Canvas 2 supports it.  I beleive MacWrite II
>does, but don't have a copy of that here.  And a few of my own programs use

  You're absolutely right, both MacDraw II and MacWrite II supports 'styl'.

  Unfourtunately the old MacWrite format (which is some sort of standard in the
MacCommunity) doesn't support 'styl' neither does Word 4.0 (as far as I can 
see) or my favourite wordprocessor WriteNow 2.0 . So what's left?

<In another article Martin Gannholm talks about XCMDs that will deliver us
from this evil.>

  This is not a HC-problem. Rather it's a tragedy for the clipboard. IMHO, HC
is not the place where to put all these conversions: these should be placed
into all these nasty wps. They should give the user the possibility to
cut/paste in the "right" way.

lac@ecs.soton.ac.uk (Les Carr) (10/19/90)

In <1990Oct18.142957.4954@sics.se> ollef@sics.se (Olle Furberg) writes:

>In <1990Oct18.030722.21087@midway.uchicago.edu> tisue@tartarus.uchicago.edu (Seth Tisue) writes:

>>if there's an answer.  Is there any way to import and/or export styled text
>>(i.e., text with boldface, italics, etc.) in and out of HC?  For example, I'd

>  HC 2.0 exports styled text by giving the style information in a scrap data
>type called 'styl'. This is the official interchange format for formatted text
>on the Macintosh, but I haven't seen any program (except HC) that obeys to
>these guidelines.

MacWrite 2 certainly does, but its the only one I've been able to find.
-- 
L.Carr@ecs.soton.ac.uk               Les Carr
Tel: +44 703 593649                  Dept of Electronics and Computer Science
Fax: +44 703 593045                  University of Southampton SO9 5NH England