Sublime Forum

Opening files in browser with SideBarEnhancements

#1

Hi there,

I’m having a slight problem with SideBarEnhancements. I’m hosting PHP files on MAMP, and if I type the URL directly into the browser, or open the directory in the browser, I can open these pages just fine.

However, it I use the “Open With” sidebar menu, in Firefox Developer I just get a window asking me if i want to download the file or open it in another app. In Chrome it just displays the raw code in the viewport.

I remember adding code specifically to open files in FF Developer - I’m sure it used to work just fine. This is the code from SideBarEnhancement:

[code]
{“id”: “side-bar-files-open-with”,
“children”:

		//application 1
		{
			"caption": "Photoshop",
			"id": "side-bar-files-open-with-photoshop",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "Adobe Photoshop CS5.app", // OSX
								"extensions":"psd|png|jpg|jpeg",  //any file with these extensions
								"args":]
							},
			"open_automatically" : false // will close the view/tab and launch the application
		},

		//separator
		{"caption":"-"},

		//application n
		{
			"caption": "Google Chrome",
			"id": "side-bar-files-open-with-google-chrome",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "Google Chrome.app",
								"extensions":".*", //any file with extension
								"args":]
					},
			"open_automatically" : false // will close the view/tab and launch the application
		},
		//application n
		{
			"caption": "Firefox Developer Edition",
			"id": "side-bar-files-open-with-FirefoxDeveloperEdition",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "FirefoxDeveloperEdition.app",
								"extensions":".*", //any file with extension
								"args":]
					},
			"open_automatically" : false // will close the view/tab and launch the application
		},


		{"caption":"-"}

	]
}

][/code]

any help would be appreciated.

si

0 Likes

#2

Browsers are configured in the Package preferences not in the open with. You need to use the “portable_browser” setting if you have a custom path.
And for the translation of a path to an URL you need to use the “Project -> Edit Preview URLs”

0 Likes

#3

This is what I’ve got in Preferences > Package Settings > Side Bar > Settings - User

{ "default_browser": "FirefoxDeveloperEdition", "portable_browser": "Applications/FirefoxDeveloperEdition.app", }

And this is what I’ve got in Project > Edit Preview URLs

{ "cmd": "open", "-a", "Applications/FirefoxDeveloperEdition.app", "http://localhost4:8888/${file/\/Users\/simon\/Sites\/LYNDA_PHP\///}"] }

But the Open With is still completely bypassing MAMP, and URL is displaying in address bar as: file:///Users/simon/Sites/LYNDA_PHP/helloworld.php

The actual URL should be: http://localhost4:8888/helloworld.php

Any ideas?

0 Likes

#4

Read the readme

0 Likes

#5

Yeah, I did use Resource Viewer to read the Readme, but I don’t really understand it.
I guess I’m quite new to this.

0 Likes