styledtext, mixed content and clipboarddata

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 10:10 am

Well . . .
-
SShot 2022-09-04 at 12.06.08.png
-
Does NOT work properly with:

1. BOLD text.

2. Sized text.
Attachments
Stylish 2.livecode.zip
Stack.
(1.21 KiB) Downloaded 116 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 10:48 am

Blast . . .
-
SShot 2022-09-04 at 12.46.01.png
-
STILL having problems with BOLD and SIZED.
-
I wonder why BOLD is being reported as "mixed"?
-
SShot 2022-09-04 at 12.49.23.png
Attachments
Stylish 3.livecode.zip
Stack.
(1.42 KiB) Downloaded 113 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 11:00 am

OK, OK, Happy Campers . . . IFF you are still keeping the faith with me . . .

1. BOLD:

I had set the word 'stout' to bold from the MenuBar:
-
SShot 2022-09-04 at 12.53.29.png
-
and setting text to "bold" like this is reported by LiveCode as "mixed" (which is badly inconsistent).

If, instead of this, a word is set to bold this way:
-
SShot 2022-09-04 at 12.52.16.png
-
it is reported by LiveCode as "bold".
Last edited by richmond62 on Sun Sep 04, 2022 11:05 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 11:03 am

2. textSize . . . bad case of my Sunday morning stupidity, because textSize
is textSize, and NOT textStyle.
-
SShot 2022-09-04 at 12.55.08.png
-
SShot 2022-09-04 at 12.56.14.png
-
Attachments
Stylish 4.livecode.zip
Stack.
(1.34 KiB) Downloaded 121 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 11:04 am

HOWEVER . . .

This is NOT useful in any way whatsoever for importing styled text from the clipboard that
originated outwith LiveCode. :(

AND, as one can just do this sort of thing:

Code: Select all

set the styledText of fld 2 to the styledText of fld 1
this whole exercise has been "one of those pointless exercises Richmond is extremely good at doing." 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 2:51 pm

After considerably more mucking about what has become clear is that the Macintosh clipboard
does NOT copy text styles between apps, BUT is does copy colours.
-
SShot 2022-09-04 at 16.49.57.png

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: styledtext, mixed content and clipboarddata

Post by stam » Sun Sep 04, 2022 4:01 pm

richmond62 wrote:
Sun Sep 04, 2022 2:51 pm
After considerably more mucking about what has become clear is that the Macintosh clipboard
does NOT copy text styles between apps, BUT is does copy colours.
Errrr... no. That statement is wrong/nonsensical.

The mac clipboard most certainly copy/pastes both styles and colours between apps.
Not sure what you're doing... see the the pic below where text created and styled/coloured in textEdit is pasted into Pages.app AND into an LC field, preserving both styles and colour on each paste.
color copy-paste with styles.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 4:19 pm

Errrr... no. That statement is wrong/nonsensical.
'nonsensical' may be subjective:

Copying from LibreOffice (as per my picture) did NOT bring BOLD across.

I shall try again . . . results on their way:
-
SShot 2022-09-04 at 18.17.05.png
-
1. No Italic.
2. No Bold.
3. No HyperLink.
4. No Size.
-
So (this should be fun),
can you explain why there is a difference between what you are getting and what I am getting? 8)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: styledtext, mixed content and clipboarddata

Post by FourthWorld » Sun Sep 04, 2022 4:22 pm

Rodney, as an experimental control have you considered trying the copy command?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: styledtext, mixed content and clipboarddata

Post by stam » Sun Sep 04, 2022 4:24 pm

Nope, not really that fun at all if i'm honest...
richmond62 wrote:
Sun Sep 04, 2022 4:19 pm
'nonsensical' may be subjective:
It is nonsensical because a) that doesn't happen and b) do you really think Apple would allow this to be the case.
richmond62 wrote:
Sun Sep 04, 2022 4:19 pm
Copying from LibreOffice (as per my picture) did NOT bring BOLD across.
And that is your answer. It must be LibreOffice not copying stuff correctly, not the "mac clipboard"

Why don't you try TextEdit, which is installed on all macs and see what results you get?

S.

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: styledtext, mixed content and clipboarddata

Post by stam » Sun Sep 04, 2022 4:32 pm

FourthWorld wrote:
Sun Sep 04, 2022 4:22 pm
Rodney, as an experimental control have you considered trying the copy command?
this still has the issue reported above.

if you use

Code: Select all

copy field 1
it doesn't paste any text (presumably because it copies the object, not the text).

if you use

Code: Select all

copy char 1 to -1 of field 1
then the issue is as per my previous post:
just copy.jpg
The only solution to Rodney's problem i can see is to specifically define the text style of the non-link text as 'plain' - then it pastes plain text with the link formatted as a link.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 4:34 pm

OK, 'darling', TextEdit it is:
-
SShot 2022-09-04 at 18.28.47.png
-
Pasting from LibreOffice to TextEdit works 100% 8)
-
SShot 2022-09-04 at 18.30.55.png
-
Pasting from TextEdit into LiveCode works 100% 8)

So, what in the name of @#$%^&! is happening between LibreOffice and LiveCode without
an intermediate (TextEdit) stage?

Whichever way you shuffle your cards (nonsensically or sensibly :P ), that should
make us think as, for the sake of argument, a developer has no way whatsoever of knowing
where an end-user is going to copy text from to paste into a LiveCode field.

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: styledtext, mixed content and clipboarddata

Post by stam » Sun Sep 04, 2022 4:41 pm

Probably just advise not to use LibreOffice on Mac then.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 4:44 pm

Copies from LibreOffice into NeoOffice 100%:
-
SShot 2022-09-04 at 18.41.07.png
-
Copies from NeoOffice to LiveCode WITHOUT bold:
-
SShot 2022-09-04 at 18.42.35.png
-
and, at that point, I will remind you what my late father told me his favourite hobby was:

Banging my head against the wall.

and why?

Because it feels great when it stops. :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: styledtext, mixed content and clipboarddata

Post by richmond62 » Sun Sep 04, 2022 4:45 pm

You are going to "T-off" quite a few clients if you issue them with a long advisory list. 8)

Noli me tangere.

Post Reply