Sublime-Notepad-Replacement icon indicating copy to clipboard operation
Sublime-Notepad-Replacement copied to clipboard

Cannot pass arguments so Open in new window

Open bacevs opened this issue 10 years ago • 1 comments

""%~dp0SublimeLauncher.exe" -n -z" This opens a new instance of notepad/sublime in a new window

However if i right click>edit a file, it opens an empty new window. The file to edit does not load.

bacevs avatar Jul 23 '13 13:07 bacevs

You can use a VBScript, I just wrote one for Sublime Text, which has embedded the -n option:

' This program is free software; you can redistribute it and/or modify it
' under the terms of the GNU General Public License as published by the
' Free Software Foundation; either version 3 of the License, or ( at
' your option ) any later version.
'
' This program is distributed in the hope that it will be useful, but
' WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
' General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program.  If not, see <http://www.gnu.org/licenses/>.
'
' DISCLAIMER
' THIS COMES WITH NO WARRANTY, IMPLIED OR OTHERWISE. USE AT YOUR OWN RISK
' IF YOU ARE NOT COMFORTABLE EDITING THE REGISTRY THEN DO NOT USE THIS SCRIPT
'

Option Explicit
Dim sCmd, x

sCmd = """" & LeftB(WScript.ScriptFullName, LenB(WScript.ScriptFullName) - LenB(WScript.ScriptName)) & "sublime_text.exe" & """ -n """
For x = 1 To WScript.Arguments.Count - 1
   sCmd = sCmd & WScript.Arguments(x) & " "
Next

sCmd = Trim(sCmd) & """"

' Wscript.Echo "sCmd: " & sCmd
CreateObject("WScript.Shell").Run sCmd, 1, True

WScript.Quit
  1. https://github.com/evandrocoan/Scripts/blob/master/ImageFileExecutionOptions.vbs
  2. http://docs.notepad-plus-plus.org/index.php?title=Replacing_Notepad Make Notepad++ the Default TXT Editor
  3. https://www.cult-of-tech.net/2011/10/replacing-notepad-with-notepad-using-image-file-execution-options/ Replacing Notepad with Notepad++ using Image File Execution Options

evandrocoan avatar Jul 28 '17 15:07 evandrocoan