The power of copy&paste

June 22nd, 2009 by Stefan Besling

After we’ve seen last week how to keep the Voxeo VoiceObjects Developer Edition well-oiled, and how to make best use of the Outline view, it’s time this week to take a look at some hands-on tips. We know that tastes differ, and that the keyboard – and particularly the CTRL+C / CTRL+V keys – have a special place in many a developer’s heart. So today we’ll take a look at the shortcut notation that can be used to create object references without ever having to touch your mouse.

Our examples use the Output object, but the same functionality is available in other structurally similar places such as e.g. the Log object. The screenshots in this article use the Canyon theme to provide some diversity.

Voxeo VoiceObjects Developer Edition is based on the concept of drag&drop, and many users will want to assemble their objects e.g by typing static portions and then bringing in object references by dragging them from the Object Browser or from the Object Palette.

dragdrop1

This creates a textual reference to the object indicated by square brackets and boldface, e.g. [V:Song]. Double-clicking the reference opens the respective object editor, and the object’s short description is displayed in a tool tip when the mouse hovers over the reference.

shortcutnotation2

Dragging and dropping is swell, but sometimes you know exactly which objects you want to reference and would prefer not to interrupt the flow of typing. And the great thing is that in these cases, you can also just type in the textual reference!

shortcutnotation1 

To make this as easy as possible, object references are validated in real time as you type. So when you start with something like [V: and then type the name of the Variable object to be referenced (more on object types below) followed by a closing bracket ] the object reference is recognized and automatically highlighted in boldface.

shortcutnotation3

But what if you mistyped the object name? Well, that’s recognized, too, and indicated by red font and question marks:

shortcutnotation4

You can simply correct the typo (in this case replace the “i” by an “o”) and the reference will again automatically and immediately change into the boldface [V:Song]. Neat, right?
And despite all the extra functionality of being clickable and showing tool tips, the shortcut notation references still are “normal” text, so you can handle them like you would any other text. In particular, you can copy and paste them e.g. from one Output item to another, or from an Output object to a Log object.

Before saving an object you should make sure that all invalid references are corrected. Why?
A correctly established object reference is stored internally as such, i.e. in our example the Voxeo VoiceObjects platform knows that when processing the Output object, it needs to refer to the value of the Variable object “Song”. When saving the Output object with the invalid reference to the “Sing” variable, no such dependency can be established and therefore what you intended as a reference will (need to) be treated as pure text. So instead of “You are about to download Like a Virgin” you’ll hear “You are about to download Sing”.

As mentioned above, the different types of objects that can be referenced using shortcut notation are identified by the initial letter following the opening bracket (note that not all types are appropriate in all places, e.g. an Output object cannot be referenced within a Log object):

  • [A:Audio] references an Audio object
  • [C:Collection] references a Collection object
  • [E:Expression] references an Expression object
  • [L:Layer] references a Layer object
  • [M:Movie] references a Video object
  • [O:Output] references an Output object
  • [S:Silence] references a Silence object
  • [V:Variable] references a Variable object
  • [X:Script] references a Script object (which is eXecutable)

So the next time you need to insert an object reference into your Output item or Log entry, be aware of your options. Nothing wrong with dragging and dropping; nothing wrong with just typing along. All just a matter of taste.

By the way, to pre-empt a common feature request: We know that it would be *really* neat if you could start typing e.g. [V:So and be presented with a list of possible completions. It’s high on our own wish list, too; stay tuned and you may see this and other things show up in future versions.

Finally, if you’re reading this close the date of original posting, there’s still time to register for our next Developer Jam Session. It’s coming up this Wednesday, June 24, at 11am Eastern and deals with Integrating advanced call control in VoiceObjects applications using CCXML.
And if you’ reading this article at your leisure later on – fear not, because our archived jam sessions are available here for your convenience.

Tags: ,

Leave a Reply