Hi All,
I know how speak a text of a native multiline control (Thanks again Dixie) and select chunk (with selectedrange)
The next step would be speak directly the selected text
Is there a way to do that ?
Best regards
Jean-Marc
How speak directly text of native multiline ?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
How speak directly text of native multiline ?
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How speak directly text of native multiline ?
Scott,
Here is the script you asked, an adaptation of a Dixie's script.
it works fine,except you have to double click on a word to open native control cut,copy,paste,replace,define and speak and click on speak.
The next step called "doSpeakByMyexternal" is not available but you can click on the speak btn.
I hope someone can find a way to do directly
Best regards
Jean-Marc
Here is the script you asked, an adaptation of a Dixie's script.
it works fine,except you have to double click on a word to open native control cut,copy,paste,replace,define and speak and click on speak.
The next step called "doSpeakByMyexternal" is not available but you can click on the speak btn.
I hope someone can find a way to do directly
Best regards
Jean-Marc
Code: Select all
local inputID
on openCard
if environment() <> "mobile" then exit openCard
iphoneControlCreate "multiline"
put the result into inputID
iphoneControlSet inputID, "rect", the rect of grc 2
iphoneControlSet inputID, "visible", "true"
iphoneControlSet inputID, "opaque", "false"
iphoneControlSet inputID, "fontName", "Helvetica"
iphoneControlSet inputID, "fontSize", 24
iphoneControlSet inputID, "textColor", "0,0,0"
iphoneControlSet inputID, "borderStyle", "none"
--iphoneControlSet inputID, "clearButtonMode", "unless editing"
iphoneControlSet inputID, "autoCapitalizationType", "sentences"
iphoneControlSet inputID, "autoCorrectionType", "Yes"
iphoneControlSet inputID, "autoClear", "true"
iphoneControlSet inputID, "text", "bonjour"
end openCard
on doSetTextInNatFld
get fld "fText"
put 1 & "," & the num of chars of it into tSelect
iphoneControlSet inputID, "text", it
iphoneControlDo inputID, "focus"
iphoneControlSet inputID, "selectedRange", tSelect
--•• ToDo
-- send doSpeakByMyexternal-- not available
--•••
end doSetTextInNatFld
on closeCard
iphoneControlDelete inputID
end closeCard
on inputBeginEditing
--put iphonecontrolGet(inputID, "text") into fld "fDev"
--iphoneControlSet inputID, "textColor", "0,0,0"
end inputBeginEditing
on inputTextChanged
--iphoneControlSet inputID, "textColor", "0,0,0"
--put iphonecontrolGet(inputID, "text") into fld "fDev"
end inputTextChanged
on inputEndEditing
put iphonecontrolGet(inputID, "text") into fld "fDev"
iphoneControlSet inputID, "textColor", "0,0,0"
--answer iphonecontrolGet(inputID, "text")
end inputEndEditing
https://alternatic.ch
-
- Posts: 125
- Joined: Sat Jan 31, 2009 12:01 am
Re: How speak directly text of native multiline ?
Jean marc,
I noted below inphonecontrolset.....does it allow selection of languages, eg. Spanish. Or just the preselected language already present in iphone's preferences?
Iphonecontrolset inputid, "text","bonjour"
Scott
I noted below inphonecontrolset.....does it allow selection of languages, eg. Spanish. Or just the preselected language already present in iphone's preferences?
Iphonecontrolset inputid, "text","bonjour"
Scott
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How speak directly text of native multiline ?
Scott,
I tried change langage on my iPad prefs and it also works in english, italian, spanish.
I didn't try Korean langage.
I didn't see a way to choose langage by script in LC dictionary. Is there one ?
Jean-Marc
I tried change langage on my iPad prefs and it also works in english, italian, spanish.
I didn't try Korean langage.
I didn't see a way to choose langage by script in LC dictionary. Is there one ?
Jean-Marc
https://alternatic.ch