Change style of a selection of a native iOS text ?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Change style of a selection of a native iOS text ?
Hello,
I don't found how change only the selection of an native text ?
Any ideas ? Thanks.
I don't found how change only the selection of an native text ?
Any ideas ? Thanks.
Last edited by ludo on Tue Apr 17, 2012 6:34 am, edited 1 time in total.
Re: Change style of a selection of a native text ?
Hi Ludo,
look at selectedChunk and textStyle in the dictionary.
make a button and a field
put
into the script of the button.
Select some text in the field and hit the button.
Kind regards
Bernd
look at selectedChunk and textStyle in the dictionary.
make a button and a field
put
Code: Select all
on mouseUp
put the selectedChunk into tChunk
set the textStyle of tChunk to bold
end mouseUp
Select some text in the field and hit the button.
Kind regards
Bernd
Re: Change style of a selection of a native text ?
Thanks,
That's the script i use for a "size" button :
but this doesn't work when i use a native iOS text with iphoneControlSet. I can't get the selectedchunck and :
i found a "selectedRange" option in the documentation but i don't know how use it.
That's the script i use for a "size" button :
Code: Select all
set the textsize of the selected chunk to (the textsize of the selected chunk)+1
Code: Select all
iphoneControlSet "text", "fontsize", "32"
-- change all the text on the field
Re: Change style of a selection of a native iOS text ?
Hi Ludo,
no space between "selected" and "chunk"
Best regards
Jean-Marc
no space between "selected" and "chunk"
Best regards
Jean-Marc
https://alternatic.ch
Re: Change style of a selection of a native iOS text ?
Yes, it's just the Lion's autocorrection which has corrected my script ! But my real script is ok. It work with a live code field but not with an "iOS field" (created by iphoneControlSet)jmburnod wrote:Hi Ludo,
no space between "selected" and "chunk"
Re: Change style of a selection of a native iOS text ?
Hi Ludo,
HOWEVER, I did not find a way to change just the selected part of the text. All changes to fontSize etc change the whole text.
Kind regards
Bernd
I made a little stack that lets you select parts of the text of a native iOS field.i found a "selectedRange" option in the documentation but i don't know how use it.
HOWEVER, I did not find a way to change just the selected part of the text. All changes to fontSize etc change the whole text.
Kind regards
Bernd