Hello, y'all!

Recently I have been using Komodo edit as my web-editor.  It has a "preview" 
screen, but it doesn't work with php.  But firefox will display my php code if 
I use a "portable server" like PortableWebAp.  I got tired of saving my work 
and then mousing over to Firefox (I have two monitors) to push the refresh 
button.  So here is my trick in three steps (watch out for wordwrap):

STEP ONE
First create the little PP function and put it in a script called 
"firefox.powerpro" in your PP script folder:

function refresh()
    wait.for (200)
    *keys {to =firefox}{f5}
    win.show("*- Komodo Edit*")

STEP TWO
Now, create the "command" script in Komodo (without key binding), and name it 
"RefreshFirefox":
"C:\Program Files\PowerPro\powerpro.exe" .fire...@refresh()

STEP THREE
Finally, "add" a new macro and paste this javascript into Komodo's macro editor:
komodo.assertMacroVersion(2);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }
_part = komodo.findPart('command', 'RefreshFirefox', '*')
if (!_part) {alert("Couldn't find a command called 'RefreshFirefox' when 
executing macro."); return
}
ko.projects.invokePart(_part);

Finally, in the "Triggers" tab of the macro's properties, check "Macro should 
trigger on a Komodo event"
and make sure "After file save" is selected.  Click okay.

Now whenever you save anything in Komodo, Firefox will refresh itself and 
Komodo will keep its focus, giving you automatic preview!  This is much better 
than Komodo's own auto-preview.  You can use Komodo's split screen with the 
html in one side and the css in the other side.  Whenever you save either you 
get the auto-preview in Firefox.  If you just used Komodo's auto-preview, you 
would have to switch back and forth between its preview of the css and its 
preview of the html. 

PP is wooooonderful!

Reply via email to