Sublime Forum

Copy to other folder on save

#1

Hi!

I’ve tried to google for this but I could not find anything that would help me with what I want. I just started to use Sublime 2 and I am blown away of the power in it. I use Netbeans now and theres a feature I really like there that I wish to have in Sublime. I have my project in a folder in my dropbox folder. When I hit save the files are copied to my localhost folder and I can review the result in my browser. I have version control and I just want to be able to copy a project to a specific folder on save. With what I’ve seen that should not be a problem but I just gotten started using Sublime and this is kind of a show stopper for me if I don’t get it to work.

I’m on OSX 10.8.5 if that does matter and I mainly do PHP.

Thanks in advance! :wink:

0 Likes

#2

I’d use a folder action.
See e.g. maclife.com/article/howtos/h … _automator.

0 Likes

#3

[quote=“adzenith”]I’d use a folder action.
See e.g. maclife.com/article/howtos/h … _automator.[/quote]

I only managed to get the folder action to fire away when a file is added and not when its saved. If you got an automator flow I’d appreciate some input on how to make on that works according to my first question.

0 Likes

#4

Oh, my bad. I guess they only work with new files… That’s lame.
I did find this: stackoverflow.com/questions/6476 … ated-files
but at a certain point I’d just write the plugin in Sublime. Just make an EventListener that has an on_post_save function.

0 Likes

#5

Maybe this? github.com/akalongman/sublimetext-autobackups

0 Likes

#6

This is a great plugin which does what you want.
github.com/bcharbonnier/SublimeFileSync

Well, it could have some features added, but it works.
Be sure to checkout the ST3 branch if you’re using version 3.

0 Likes