Add format to a string
Add format to a string
- Subject: Add format to a string
- From: Joseph Weaks <email@hidden>
- Date: Mon, 25 Oct 2004 13:33:04 -0500
I'd like a handler that would apply the bold style a specified sub-string in the first occurrence (or everywhere it is found if that's easier) in a string. I have read through StyledText <-> Record.scpt by julifos and still am not sure how to make a simplified handler for what I'm wanting. I'm looking for something like this:
on wholeString, subString)
-- returns styled text where subString becomes bold.
-- options for italic, color, highlight would be nice, as well
end formatSubString
formatSubString("This is a bold statement.", "bold")
-- Result:
This is a bold statement.
I am undecided if the wholeString should retain any style info it has at the beginning. Also, a third parameter allowing one to specify italics or color or highlighting or even font size or name instead of bold would be just swell.
Thanks,
Joe Weaks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden