Alright, looks like this could work so long as the command doesn't reference any variables in the local sandbox.
for instance, I'm trying to execute the "email" command, but unfortunately it requires the context variable to get the document of the focused window. Are there any plans to allow the email command to have the document passed in (along with any other needed parameters)? I suppose I shall just snag the necessary code for a local email function. Any other interest in this sort of thing? What are the feelings on command chaining? On Feb 25, 6:48 pm, GooseusTheGreen <[email protected]> wrote: > Alright, looks like these (pulled from mouse.js, suggested by atul in > another post of the same sort) is the functions I need. Am I > correct? Any plans to develop this functionality in to CmdUtils or > another library? > > function getUbiquity(){ > var mainWindow = window.QueryInterface > (Components.interfaces.nsIInterfaceRequestor) > .getInterface > (Components.interfaces.nsIWebNavigation) > .QueryInterface > (Components.interfaces.nsIDocShellTreeItem) > .rootTreeItem > .QueryInterface > (Components.interfaces.nsIInterfaceRequestor) > .getInterface > (Components.interfaces.nsIDOMWindow); > > return mainWindow.gUbiquity; > > } > > function getCommandByName( name ) { > var ubiq = getUbiquity(); > return ubiq.__cmdManager.__cmdSource.getCommand( name ); > > } > > function executeCommand( commandName, mods ) { > var cmd = getCommandByName( commandName ); > var selText = CmdUtils.getWindow().getSelection().toString(); > selText = selText || LAST_SEL_TEXT; > LAST_SEL_TEXT = selText; > > cmd.execute( {}, {text:selText}, mods || {} ); > > } > > On Feb 25, 6:33 pm, GooseusTheGreen <[email protected]> wrote: > > > Alright, maybe I'm having trouble with my wording here. What I'm > > looking to do is make a command that grabs information from a web > > service and then puts it in a new email to my contact. For > > instance... > > > get-asset-to-email (assetID) (email) > > > Everything is fine, but I am not sure how to access the other commands > > (ie email) from within my command... is this not possible yet? I > > can't imagine being forced to rewrite the "email" command in to my > > command function just to do this. > > > Can I maybe send a command to the ubiquity command line from within my > > function? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ubiquity-firefox" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ubiquity-firefox?hl=en -~----------~----~----~----~------~----~------~--~---
