Page 1 of 1

How speak directly text of native multiline ?

Posted: Sun Feb 22, 2015 7:42 pm
by jmburnod
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

Re: How speak directly text of native multiline ?

Posted: Tue Mar 10, 2015 8:58 am
by jmburnod
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

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

Re: How speak directly text of native multiline ?

Posted: Sun Mar 15, 2015 9:04 pm
by scotttyang
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

Re: How speak directly text of native multiline ?

Posted: Sun Mar 15, 2015 11:13 pm
by jmburnod
Scott,
I tried change langage on my iPad prefs and it also works in english, italian, spanish. 8)
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