Sublime Forum

Click "Run" in FireBug

#1

I have a video that illustrates this but I am not sure that I can add it here. I want to write code in sublime hit ctrl+something and have it execute in firebug. Eventually I would like to expand on that to display output in st, but i can live without that.

0 Likes

#2

my advice would be to ask the creator of the video for instructions :wink:

0 Likes

#3

I did a little research and it would appear that there is no easy way to get FireBug to do anything apart from your manually telling it to (e.g. faking keyboard events or some such).

What exactly are you trying to achieve? Do you just have some JavaScript that you want to run, or does it have to do something to the DOM as well?

If you just want to run JavaScript code without being in a browser environment you could use something like Rhino, NodeJS or (possibly; would require a bit more work) Cesanta V7.

Failing that, things get tricky fast as far as communicating between Sublime and the browser.

Depending on what you are trying to accomplish, you might be able to use the LiveReload plugin; if your JS was embedded in a web page, that could get it to reload the page, which would re-run the JavaScript.

0 Likes

#4

You might have some luck with MozRepl, which provides an interace for what you need. You then need a plugin that runs inside ST and uses MozRepl’s interface to access the browser.

1 Like

#5

Thanks all for the ideas. I mostly develop in Firebug but I do not like the IDE, I can position ST over the code window and I’ve rigged firebug to read from a file rather than it’s own window, so the missing piece is a keystroke. Since ST has the focus it requires a mouse click.

0 Likes

#6

Is there a hotkey assigned to it? Possibly there is some way to fake a key combination directed at it (like AutoHotKey or some such)?

[edit]

An example of something like this for Linux is xdotool. I’m not sure if there’s a MacOS analog although possibly AppleScript or some such? I’m not much of a Mac Power User in that regard.

0 Likes

#7

Thanks for the idea, I could probably hack something like that with xdotool, or Autohotkey (for windows) I even found a image recognition program that does similar scripting. These solutions are all very hacky. Probably Firebug can get outside of the Firefox space to respond to events so looks like there isn’t a better solution than what you’ve proposed.

0 Likes