Sublime Forum

SideBar Enhanc.. (Clipboard, Open With., Reload renamed)

#1

Description

Provides enhancements to the operations on Side Bar of Files and Folders for Sublime Text 2. See: sublimetext.com/

Provides the basics: new file/folder, edit, open/run, reveal, find in selected/parent/project, cut, copy, paste, paste in parent, rename, move, delete, refresh…

The not so basic: copy paths as URIs, URLs, content as UTF8, content as data:uri base64 ( nice for embedding into CSS! ), copy as tags img/a/script/style, duplicate, open with…

All commands available for files and folders(when applicable) .


Installation

Source-code

github.com/titoBouzout/SideBarEnhancements

Forum Thread

viewtopic.php?f=5&t=3331

0 Likes

Deleting Folders
Rename file in side bar
[Serious Sublime Problem]: File Deleted, Never comes back
Better delete and rename in side bar
Get back deleted file
SidebarEnhancements "open in browser" do nothing when clickd
Removing a file still want to be saved
Some suggestions from an Ultraedit user
[BUG Build 2122] Renaming file doesn't update opened tab
Tabs don't auto-update when file name or path changes OS X
Extending SideBar, questions, suggestions
Image-Viewer
Image-Viewer
Is it possible
Extending SideBar, questions, suggestions
Image-Viewer
#2

Excellent, I was just thinking about the need for something like this; thank you! Can’t wait for Open With to hook GrepWin into.

0 Likes

#3

Love the new additions. I just pulled the latest version down.

If you want to add the width/height to the IMG tag functionality, you can just do something like this in python:

[code]import Image

image_file = “foo.jpg”
img = Image.open(image_file)

get the image’s width and height in pixels

width, height = img.size[/code]

-nobleach

0 Likes

#4

nobleach, module Image is not available at ST, but I’ve found this from project bfg-pages which seems to work great. : )

Update v0.3:

  • Fixed: Open should run correctly with some strange characters on paths
  • New: “Open with…” is enabled and allows to set custom applications for different file extensions.
  • New: “Copy content as Data URI” ( handy for embedding images on CSS files )
  • Improved: Copy img tags now add attributes width and height thanks to project bfg-pages and suggestion from nobleach.

Wanted!

  • A small contribution if you can
  • Feedback from linux, mac and Windows 7 users, I tested this only on WinXP. It works? Something wrong? Something good?: P

Regards

0 Likes

#5

What exactly does this mean?

Open file "Sublime Text 2/Packages/Default/Side Bar.sublime-menu" and comment everything with /* here file contents */

The plugin is installed & working but I think I may be missing something because I have not sone this…

Can I also ask about adding apps to the Open with dialog? How do I do it? Here’s where I’m at so far:

[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": "\\Applications\\Adobe CS5\\Adobe Photoshop CS5\\Adobe Photoshop CS5.app",
								"extensions":"psd|png|jpg|jpeg|gif"  //any file with these extensions
							}
		},

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

		//application 2
		{
			"caption": "Espresso",
			"id": "side-bar-files-open-with-espresso",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "\\Applications\\ Programming\\Espresso.app",
								"extensions":"css" //open all even folders
							}
		},
		//application n
		{
			"caption": "CSS Edit",
			"id": "side-bar-files-open-with-css-edit",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "\\Applications\\ Programming\\CSSEdit.app",
								"extensions":"css" //any file with extension
							}
		},

		{"caption":"-"}
	]
}

][/code]
Are the forward slashes supposed to, now, be two back slashes?

This is one of the few things that ST2 was missing, thank you so much!

0 Likes

#6

[quote=“MrMartineau”]What exactly does this mean?

Open file "Sublime Text 2/Packages/Default/Side Bar.sublime-menu" and comment everything with /* here file contents */

The plugin is installed & working but I think I may be missing something because I have not sone this…
[/quote]

Sublime already comes with the functions: “new”, “rename”, “delete” and “find” on context menu. These functions are included into this plugin with changes… improving a little bit… In order to hide the defaults you need to open that file and comment everything. If not, there should be two “new file”, “rename”, “delete”… on your menu right now

Looks good, but forward slashes is for Windows. I guess… Mac should be “/Applications/ Programming/CSSEdit.app” I’m not sure.

To add more applications just copy and paste the last entry many times as you want.

[quote]//separator
{“caption”:“Espresso”},[/quote]

That’s just a separator ------------, should looks like this:

[quote]//separator
{“caption”:"-"},[/quote]

Once you made the changes, with time, please, back here to comment if all works good for you, since I don’t have a Mac system to test. Thanks

You welcome Mr!

0 Likes

#7

tito, thanks for you help so far but I’m afraid to say that I need some more…

My sublime-menu file now looks like this:

[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": "/Applications/Adobe CS5/Adobe Photoshop CS5/Adobe Photoshop CS5.app",
								"extensions":"psd|png|jpg|jpeg|gif"  //any file with these extensions
							}
		},

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

		//application 2
		{
			"caption": "Espresso",
			"id": "side-bar-files-open-with-espresso",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "/Applications/ Programming/Espresso.app",
								"extensions":"css" //open all even folders
							}
		},
		//application n
		{
			"caption": "CSS Edit",
			"id": "side-bar-files-open-with-css-edit",

			"command": "side_bar_files_open_with",
			"args": {
								"paths": ],
								"application": "/Applications/ Programming/CSSEdit.app",
								"extensions":"css" //any file with extension
							}
		},

		{"caption":"-"}
	]
}

][/code]
and the apps are all shown in the sidebar, but they still do not work. The actual path for the apps, is slightly different, for example, this is Photoshop’s:

/Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.ap

but when I add that, no apps show in the ‘Open with’ menu…

Any ideas?

0 Likes

#8

If there is a backslash in that file it should be double. \ instead of \

Question: If you selected from the menu “Open / Run” on a Photoshop file ( above of “Open with…” ) it opens the file with some application?

0 Likes

#9

In theory if you type in cmd

/Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app "/somefolderto/photoshopfile.psd"

If that is not the case… maybe this?

open -a /Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app "/somefolderto/photoshopfile.psd"

Let me know which command works for you, I can update to check os exceptions.

0 Likes

#10

[quote=“tito”]nobleach, module Image is not available at ST, but I’ve found this from project bfg-pages which seems to work great. : )

Update v0.3:

  • Fixed: Open should run correctly with some strange characters on paths
  • New: “Open with…” is enabled and allows to set custom applications for different file extensions.
  • New: “Copy content as Data URI” ( handy for embedding images on CSS files )
  • Improved: Copy img tags now add attributes width and height thanks to project bfg-pages and suggestion from nobleach.

Wanted!

  • A small contribution if you can
  • Feedback from linux, mac and Windows 7 users, I tested this only on WinXP. It works? Something wrong? Something good?: P

Regards[/quote]

GREAT, I’m loving it! Yeah, I think the lack of a full python was also biting the guy working on the Color-Picker plugin. Glad to see you found a way around it.

Thanks again for your work!

-nobleach

0 Likes

#11

Using this opens Photoshop:open -a /Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app but adding a filename as you suggested did not work. Instead I got an error: The file *** does not exist.
This one gave an error: /Applications/Adobe CS5/Adobe Photoshop CS5/Adobe Photoshop CS5.app: is a directory
Thanks for you help so far… nearly there!

P.S. I think I need to edit my forum signature once I have this sorted… cl.ly/AwEr

0 Likes

#12

: D Almost

With this as the line of the application in the config file:

"application": "/Applications/Adobe\\ CS5/Adobe\\ Photoshop\\ CS5/Adobe\\ Photoshop\\ CS5.app",

And downloading the new version I uploaded five minutes ago, can you please test.

Crossing fingers :mrgreen:

Additional questions! ( unrelated to above )

  1. Over a photoshop file, pressing on context menu “Open / Run” opens photoshop?
  2. Over a any file/folder, pressing on context menu “Reveal” opens Finder with the file/folder focused?
  3. Careful with this one!! When you delete a file via the context menu, the file is sent to the “trash”?
    Thanks
0 Likes

#13

[quote=“tito”]: D Almost

With this as the line of the application in the config file:

"application": "/Applications/Adobe\\ CS5/Adobe\\ Photoshop\\ CS5/Adobe\\ Photoshop\\ CS5.app",

And downloading the new version I uploaded five minutes ago, can you please test.

Crossing fingers :mrgreen:
[/quote]

It still does not work for me I’m afraid… :frowning: I uninstalled the plugin, then reintalled it with Package Control. Where am going wrong? Should the app be open already? I even tried without the new backslashes you added, to no avail.

0 Likes

#14

Hey Mr, try to open a psd file from the cmd, once you get the file opened let me know which command works for you. Please come back with the complete line without encryption ; )

I want to suggest you to try the following

  open -a /Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app /User/path/to/some/psd/file/this.psd

With quotes:

  open -a /Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app "/User/path/to/some/psd/file/this.psd"

What about my other questions?

0 Likes

#15

In Linux I can open files using “Open/Run” but “Open with” doesn’t work

I’ve tried evince, eog and gnome-font-viewer.eog and evince open but with a blank window. gnome-font-viewer never opened. I think “Open with” never receives selected filename.

0 Likes

#16

Hi xavi, I think is fixed now~, It works for me when using just the application name, I think it should be on PATH,
for example:

{ 
	"caption": "Firefox",
	"id": "side-bar-files-open-with-firefox",    
	   
	"command": "side_bar_files_open_with",     
	"args": {
			"paths": ],
			"application": "firefox",
			"extensions":".*" //any file with extension
	} 
},

Let me know if that works for you.

0 Likes

#17

[quote=“tito”]Hi xavi, I think is fixed now~, It works for me when using just the application name, I think it should be on PATH,
for example:

{ 
	"caption": "Firefox",
	"id": "side-bar-files-open-with-firefox",    
	   
	"command": "side_bar_files_open_with",     
	"args": {
			"paths": ],
			"application": "firefox",
			"extensions":".*" //any file with extension
	} 
},

Let me know if that works for you.[/quote]

After this upgrade it works like a charm. Great job!!!

0 Likes

#18

[quote=“tito”]Hey Mr, try to open a psd file from the cmd, once you get the file opened let me know which command works for you. Please come back with the complete line without encryption ; )

I want to suggest you to try the following

  open -a /Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app /User/path/to/some/psd/file/this.psd

With quotes:

  open -a /Applications/Adobe\ CS5/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5.app "/User/path/to/some/psd/file/this.psd"

What about my other questions?[/quote]

Both examples open Photoshop but neither open the file… but when PS is already open, both examples successfully open the file…

P.s. Apologies for the delayed response, I didn’t know that anyone replied to me… when can we get an improved forum?

0 Likes

#19

Can you please answer this:

[quote=“tito”]

Additional questions! ( unrelated to above )

  1. Over a photoshop file, pressing on context menu “Open / Run” opens photoshop?
  2. Over a any file/folder, pressing on context menu “Reveal” opens Finder with the file/folder focused?
  3. Careful with this one!! When you delete a file via the context menu, the file is sent to the “trash”?
    Thanks[/quote]
0 Likes

#20

[quote=“tito”]Can you please answer this:

[quote=“tito”]

Additional questions! ( unrelated to above )

  1. Over a photoshop file, pressing on context menu “Open / Run” opens photoshop?
  2. Over a any file/folder, pressing on context menu “Reveal” opens Finder with the file/folder focused?
  3. Careful with this one!![/quote]

When you delete a file via the context menu, the file is sent to the “trash”?
Thanks[/quote]

In answer to your questions:

  1. This does not open Photoshop & with the command log turned on I get this:
command: side_bar_open {"paths": "/Users/MyUser/Dropbox/Work/Web/Clients (Current)/Client1/Logo/Logo.psd"]}
  1. Reveal works as expected
  2. Delete does not work for me

Open with return this in the console:

command: side_bar_files_open_with {"application": "/Applications/Adobe\\ CS5/Adobe\\ Photoshop\\ CS5/Adobe\\ Photoshop\\ CS5.app", "extensions": "psd|png|jpg|jpeg|gif", "paths": "/Users/MyUser/Dropbox/Work/Web/Clients (Current)/Client1/Logo/Logo.psd"]}
0 Likes