Groups | Search | Server Info | Login | Register


Groups > comp.databases.filemaker > #3542

Re: Script to Format Selaction in a Text Field

From Martin Τrautmann <t-usenet@gmx.net>
Newsgroups comp.databases.filemaker
Subject Re: Script to Format Selaction in a Text Field
Date 2025-05-27 08:51 +0200
Organization slrn user
Message-ID <slrn103ao6r.4je.t-usenet@ID-685.user.individual.de> (permalink)
References <0001HW.2DE5299B01544BBC309C3E38F@news.astraweb.com>

Show all headers | View raw


On Mon, 26 May 2025 18:58:35 -0400, Jack Nastyface wrote:
> I want to color some text in a text field using a script but I can’t figure 
> out a way to do it. There doesn’t seem to be an applicable script step. Any 
> ideal?

You want to select some part of the text only?

I guess the main problem is not to leave focus on the current location.

I just tried and found with a current FMP version that you stay on your
current editing location if you go to another file. So create a new file
"Formatting" with just one text field "RTF", maybe global storage.
Script:

* Cut text
* Goto File "Formatting"
* Paste to field "RTF" [select entire contents)

# check for selected text
* if ( length(RTF) = 0)
...go back to the original file and select the entire text field. If the
length of the original text field = 0, exit the script there. Otherwise
it will be an endless loop.


Text formatting then can be applied on that field RTF, such as 
* TextColor (RTF; RGB())
* TextFont (RTF; fontname)
* TextSize (RTF; size)
* TextStyleAdd (RTF, ...) e.g. italic+doubleunderline

* cut RTF
* go back to original file
* paste

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Script to Format Selaction in a Text Field Jack Nastyface <nowhere@noplace.com> - 2025-05-26 18:58 -0400
  Re: Script to Format Selaction in a Text Field Martin Τrautmann <t-usenet@gmx.net> - 2025-05-27 08:51 +0200
    Re: Script to Format Selaction in a Text Field Jack Nastyface <nowhere@noplace.com> - 2025-05-27 08:14 -0400
      Re: Script to Format Selaction in a Text Field Martin Τrautmann <t-usenet@gmx.net> - 2025-05-27 15:30 +0200

csiph-web