0

Can I have Sublime Text automatically run another command after Sublime SFTP plugin performs an upload? Maybe it could trigger a terminal command or system service (that I set up using OSX's Automator)?

This is what I am specifically trying to do... I have Sublime SFTP configured to automatically upload on save. I also have a system service which reloads the active tab in Safari. I would love if pressing CMD-S to save, not only uploads, but reloads active browser tab after upload is complete. Is there is a way I can trigger a command after the SFTP plugin is finished uploading?

Thank you in advance!

Jesse Leite
  • 6,581
  • 3
  • 18
  • 17

1 Answers1

2

There are a couple of options here:

  1. There are plugins that support live-preview or refresh on save capabilities. For Example https://sublime.wbond.net/search/Refresh or LiveReload

  2. The Chain of Command plugin allows you to execute multiple commands subsequently

adibender
  • 7,288
  • 3
  • 37
  • 41
  • 1
    I tried LiveReload, and it works... though if I have to wait for an upload, I have to set a delay so that browser refreshes after upload. I am messing around with Chain of Command... thanks for recommendation. I think this is the way to go :) Do you know if Chain of Command supports command args though? – Jesse Leite Feb 23 '14 at 01:47
  • If you look at the readme for the "Browser Refresh" package, when setting key binding you can pass "activate_browser": true/false as argument into "browser_refresh" command. My biggest problem with this workflow now is that when I use Chain of Commmand and Browser Refresh together, it sets focus on my browser by default. If I could pass that "activate_browser":false argument into Chain of Command, I'd be really happy :) – Jesse Leite Feb 24 '14 at 02:47
  • @JerseyMilker Have you tried setting `"activate_browser": false` as default in your user-settings? – adibender Feb 25 '14 at 00:03