manipulating attributes of text in fields from scripts

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

manipulating attributes of text in fields from scripts

Mark Waddingham via use-livecode
I have a number of label fields which inadvertently have bold text in them.
  I can identify these in a loop from their text, and put the long id of
the field into tgTg.

Shouldn't one of

*set* the textStyle of tgTg to "plain"

or

*set* the textStyle of char 1 to -1 of the text of tgTg to "plain"



do this?

I'm trying to completely obliterate any bold settings, and there may be
bits of boldoff-boldon between characters(?) of the pdf source I paste.
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: manipulating attributes of text in fields from scripts

Mark Waddingham via use-livecode
Try

Set the textstyle of char 1 to -1 of field "my field" to empty


You can also do this:
Put field "my field" into field "my field"

That will put the text - without formatting - into the field content

Sent from my iPhone

> On Apr 10, 2017, at 8:29 PM, Dr. Hawkins via use-livecode <[hidden email]> wrote:
>
> I have a number of label fields which inadvertently have bold text in them.
>  I can identify these in a loop from their text, and put the long id of
> the field into tgTg.
>
> Shouldn't one of
>
> *set* the textStyle of tgTg to "plain"
>
> or
>
> *set* the textStyle of char 1 to -1 of the text of tgTg to "plain"
>
>
>
> do this?
>
> I'm trying to completely obliterate any bold settings, and there may be
> bits of boldoff-boldon between characters(?) of the pdf source I paste.
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: manipulating attributes of text in fields from scripts

Mark Waddingham via use-livecode
Also - to affect the field by id you need to say this:

Set the textstyle of char 1 to -1 of field id tgtg to empty

There is a difference between bolded chars and a bolded field. So, you would need to know which is the source of bolding, or just fix them both.

Sent from my iPhone

> On Apr 10, 2017, at 8:43 PM, [hidden email] wrote:
>
> Try
>
> Set the textstyle of char 1 to -1 of field "my field" to empty
>
>
> You can also do this:
> Put field "my field" into field "my field"
>
> That will put the text - without formatting - into the field content
>
> Sent from my iPhone
>
>> On Apr 10, 2017, at 8:29 PM, Dr. Hawkins via use-livecode <[hidden email]> wrote:
>>
>> I have a number of label fields which inadvertently have bold text in them.
>> I can identify these in a loop from their text, and put the long id of
>> the field into tgTg.
>>
>> Shouldn't one of
>>
>> *set* the textStyle of tgTg to "plain"
>>
>> or
>>
>> *set* the textStyle of char 1 to -1 of the text of tgTg to "plain"
>>
>>
>>
>> do this?
>>
>> I'm trying to completely obliterate any bold settings, and there may be
>> bits of boldoff-boldon between characters(?) of the pdf source I paste.
>> --
>> Dr. Richard E. Hawkins, Esq.
>> (702) 508-8462
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: manipulating attributes of text in fields from scripts

Mark Waddingham via use-livecode
To clear all styles, links, etc.:

   put field "Whatever" into field "Whatever"

To clear only bold and leave everything else:

   set the textStyle["bold"] of char 1 to -1 of fld "Whatever" to false

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...