How to fetch the text spoken to cortana while the SpeechRecognitionResult.Text is returning "..." - Windows UWP - win-universal-app

While deep linking Windows UWP apps with cortana, I'm unable to fetch the text spoken. In the Voice Command Definition file I'm using a <ListenFor> element with {*} in order to allow user to speak anything, but I'm unable to fetch it.

If you're trying to set up a VCD to accept freeform dictated text, you'll need to use a PhraseTopic field. See the 1.2 VCD spec for details.
For example, if you've got a Command block containing
<ListenFor> Take a note to {noteTopic} </ListenFor>
You'd want a corresponding PhraseTopic
<PhraseTopic Label="noteTopic" Scenario="Dictation">
</PhraseTopic>
There's various options (Subjects and Scenarios) you can use to refine the dictation service's behavior.

You could also use Scenario="Search" and have you VCD look something like this:
<ListenFor> Take a note to {noteTopic} </ListenFor>
<PhraseTopic Label="noteTopic" Scenario="Search"/>

Related

Storing and retrieving files in Blockly Web

I want to use Blockly to do some calculations, and then generate text files (as opposed to exporting code to JavaScript, Python, PHP, etc.)
I can’t see an obvious way to create my own blocks to do this in Blockly, so using AppInventor (Version: nb168), I got storing and retrieving files to work, in a crude test app on my Android tablet.
In AppInventor/Designer mode, clicking Storage/File creates a “Non-visible component for storing and retrieving files. Use this component to write or read files on your device.”
Then, in AppInventor/Blocks mode, clicking the “File1” icon gives access to 7 “file type blocks”, e.g. AppendToFile, Delete, ReadFrom, SaveFile, etc.
Is it possible to create similar “file type blocks” to use in Blockly Web?
I have limited programming knowledge, so would appreciate simple answers, please.
Thanks, Pete.
Andrew N Marshall from Google/Blockly has told me this:
"This is absolutely possible ...as long as you willing to work within the browser's security restrictions. The resulting files will be need to be manually "downloaded" one at a time, rather than written directly to the user's file system.
... I would start understanding what JavaScript functions are available to you. Attempt to construct a string and save it via a download dialog...
That means the "file" contents are really just a string in memory, a JavaScript variable. We have lots of "Text" blocks that can do a variety of operations on strings. If those are enough, you'll only need one new block to identify the string variable and initiate the download process.
Otherwise, you'll need to think about what blocks you want, and how they operate. They may operate on a specific variable in the JavaScript VM, not necessary exposed as a variable to Blockly.
Either way, you'll need to learn how to create a block and a Blockly app. We have a code lab that will walk you through all the steps. You'll learn how each block generates a string of code, and in your case, that code will be related to the download code I mentioned earlier."
So I'll press on - I just wanted to be sure my goal is actually achievable before I started.
Thanks, Pete.

Does Blockly have a file selector?

I am looking to use Blockly to allow non-techie users to specify test scripts.
One part of it will require a File Selector, however, I can't see that Blockly has one. Does it?
Actually, I can't find a complete list of standard blocks. Does anyone have a URL?
If there is no standard Blockly File Selector, (how) can I access the Windows File Selector? (and how, in general, can I execute DOS commands?)
As far as I know, I think that you cannot get a File Selector from Blockly but maybe this post is useful for you in which a man creates a custom Block for this purpose.
Also, I could not find a list with only the names of all the standard blocks but I saw that on the playground of Blockly you can see all the standard blocks that Google provides to you. If you want to see the code of all of them you can see it on Blockly GitHub.
I suppose that if Blockly does not have a File Selector it will not also has access to the Windows File Selector but maybe you can create a custom Block for that purpose via Javascript (I do not know what programming language are you using for). This link can help with Javascript Windows File Selector.
I expect it will be useful for you!
You can override the showEditor_ function on a blockly input - this works quite well with FieldTextInput. See https://youtu.be/eYHo0VeSLCI for an example of an 'intercepted' click opening a jquery mobile dialog, that then fills in the text value. The text value is then retrieved by the javascript generator to load the selected file at 'runtime'.
I've pasted below some cut down code:
Show a standard text input
let fileInput = new Blockly.FieldTextInput('** CHOOSE A FILE **')
Then you can attach a click handler which would show your file selector - so the standard browser file selector may do...
fileInput.showEditor_=(()=>alert("Intercepted"))
You'll need to replace the alert with your file selector code. Your code will also need to set the value of the text input - with something like this:
let block = Blockly.mainWorkspace.getBlockById(block_id)
block.setFieldValue(filename, widget_id)
Where widget_id identifies the text input and block_id the actual containing block.

how to access google define feature in a batch

Suppose I have a huge set of noisy phrases. For each one of them, I want to check if it is defined by some resources by using the google define feature. Once I type "define my_phrase" to the google search box, if the retrieved results contain the definition panel (e.g. https://www.google.com/#q=define+home+cooking), I put it into my phrase pool.
I'm wondering is this possible to do this task in a batch so that I don't have to type each of the phrase manually one by one? It would be great if this could be achieved from a unix terminal but windows is also welcome!
I heard of google-app-engine but I only have a rough idea and not sure if it could help.
Thanks!
as starting point, you may try and play with the Google Custom search following API reference - Xml results
https://developers.google.com/custom-search/docs/xml_results?hl=en&csw=1#XML_Results
Be aware of:
google TOS for this service
quantity courtesy limit

showing HTML in field instructions, not rendering?

I have a field for embedding videos. In the description I would like to show a sample of what that code should look like. However natively EE will render the HTML. Is there a way to show exactly what the code should look like without it being rendered? Other fields have HTML that needs to render so if there is a global on/off it must be on.
Have a look at NSM Publish Hints
If we are talking about a specific CF in a channel, the way I go about it is as follow:
For external services (youtube/viemo): have a custom field (text) where people just have to paste in the ID of the video, and another field (P&T pill or dropwown) where editors choose the service (vimeo, youtube). The various embed codes are handled on the template side within an if/else or case logic
For HTML5 self hosted videos: have several file fields letting people choose videos in the various needed formats. These videos are uploaded through FTP and synced using the file manager.
Copy and paste your code into this Encoder and paste the output into the description field:
http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/encode.aspx

Windows phone strings and localization

A vanilla Windows Phone device is populated with many string resources - for example 'Settings' and beneath 'Settings' lies 'location' among others. At least this is the case for the en-GB UI language. I would like to access the full list of device-loaded strings, not just for en-GB, but for every UI-supported language. That is, I'm looking for the full list of en-GB UI strings, plus their parallel translations in the full set of UI-supported languages. Can anyone help me find them? Do I need a special SDK? Does Microsoft simply 'publish' them somewhere? Or do I need to write some C# to query an on-phone assembly?
The strings used by the OS and the native apps are not available via any public method.
If you are looking to translate your app you need to translate text in context to where you use it. It is not a straight copy and paste exercise. This means you can't just reuse the translations from another source. (Unless it's the exact same context.)

Resources