Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass arguments so Open in new window #5

Open
bacevs opened this issue Jul 23, 2013 · 1 comment
Open

Cannot pass arguments so Open in new window #5

bacevs opened this issue Jul 23, 2013 · 1 comment

Comments

@bacevs
Copy link

bacevs commented Jul 23, 2013

""%~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.

@evandrocoan
Copy link

evandrocoan commented Jul 28, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants