Command editor does not seem to work
I tried to add the 'chain' command via the command editor. Was able to invoke the editor and paste the following code:
function chain(commands, nameCommand){
var commands = commands.split(",");
CmdUtils.CreateCommand({
name: nameCommand,
takes: {argument : noun_arb_text},
execute: function(directObject){
//displayMessage(directObject.text);
for(var i = 0; i<commands>, directObject.text);
displayMessage(command);
var context = {
screenX: 0,
screenY: 0,
lastCmdResult: null
};
context.focusedWindow = window.document.commandDispatcher.focusedWindow;
context.focusedElement = null;//window.document.commandDispatcher.focusedElement;
window.gUbiquity.__cmdManager.updateInput(command,context);
window.gUbiquity.__cmdManager.execute(context);
}
}
});
}
However, this command does not appear in my list of commands nor can I invoke it.
function chain(commands, nameCommand){
var commands = commands.split(",");
CmdUtils.CreateCommand({
name: nameCommand,
takes: {argument : noun_arb_text},
execute: function(directObject){
//displayMessage(directObject.text);
for(var i = 0; i<commands>, directObject.text);
displayMessage(command);
var context = {
screenX: 0,
screenY: 0,
lastCmdResult: null
};
context.focusedWindow = window.document.commandDispatcher.focusedWindow;
context.focusedElement = null;//window.document.commandDispatcher.focusedElement;
window.gUbiquity.__cmdManager.updateInput(command,context);
window.gUbiquity.__cmdManager.execute(context);
}
}
});
}
However, this command does not appear in my list of commands nor can I invoke it.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Oh, man, I don't even know where to begin. You need to take another look at the tutorials, and read some code done by others. Or, give me a clue as to what you're trying to accomplish, and I'll try to make better sense of it.
Everything goes inside *CmdUtils.CreateCommand*.
*name:* is the command name.
In *takes*, 'argument' needs quotes, and is an explanation of what the user needs to type. Like the google command's (search term).
CmdUtils.CreateCommand({
name: "chain",
takes: {"argument": noun_arb_text},
execute: function(chain, nameCommand)
{
...
}
})
Again, it'd be awesome if I knew what you were trying to do. ^^
I’m orgasming
-
Ah... thanks sometimes another eye can spot the obvious which escapes me. Trying to chain commands together to form a new command... -
Inappropriate?Hi Rowanrook,
Try some simpler commands in the command-editor first. Like, just a "hello world" command, and make sure that works. I suspect that the problem is with function chain() and not with your command editor per se. CreateCommand is meant to be called as a top-level function in a command file; calling it from inside another function may not work as intended.
Trying to make a command that chains other commands together.... may be possible, but it's going to be difficult to make it work the way you want. Really, I think this needs to be a core ubiquity feature, not something that's added in a 3rd party command feed.
In fact, we're already working on it. There's a ticket filed for this feature here:
http://labs.toolness.com/trac/ticket/68
I’m sorry
Loading Profile...




