Created
October 6, 2016 04:31
-
-
Save ethangardner/51bd83aae9972db5162455fbff719290 to your computer and use it in GitHub Desktop.
Komodo macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Macro recorded on: Wed Oct 05 2016 22:55:50 GMT-0400 (Eastern Standard Time) | |
komodo.assertMacroVersion(3); | |
if (komodo.view) { komodo.view.setFocus(); } | |
(function(){ | |
var currentView = ko.views.manager.currentView; | |
var scimoz = currentView.scimoz; | |
var path = ko.interpolate.interpolateString(["%F"]); | |
var project = ko.interpolate.interpolateString(["%i"]); | |
var platform = navigator.platform.toLowerCase(); | |
if (currentView === undefined) { | |
return false; | |
} | |
if (platform.indexOf("win") != -1) { | |
path = path.replace(/\\/gi,'/'); | |
project = project.replace(/\\/gi,'/'); | |
} | |
path = path.split(project); | |
if(path.length >= 2) { | |
path = path[1]; | |
} | |
if(path.indexOf('/') === 0) { | |
path = path.substring(1, path.length); | |
} | |
scimoz.insertText(scimoz.currentPos, path); | |
scimoz.gotoPos(scimoz.currentPos); | |
currentView.setFocus(); | |
ko.commands.doCommand('cmd_comment'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment