Sublime Forum

Open all ST opened files in external application

#1

Hi,

I’m using sublime text 2 as my programming IDE in PHP. Unfortunately,I haven’t found a possibility to debug my code using Zend Debugger.
To work with the debugger I would like to open all opened files in Sublime Text 2 in an external application like Zend Studio (based on Eclipse).
Via applescript I can open files in the running Zend Studio instance using the terminal with
open -a “Zend Studio” /path/to/file1 /path/to/file2

Can someone point me to the right direction how to write a plugin for Sublime Text 2 that would pass all open filepaths to that simple terminal command and call it?
Is this even possible?

Thanks for any help!

Regards
Thomas

0 Likes

#2

Something like:

on_load(view): subprocess.popen('open', '-a', '"Zend Studio"', view.file_name()])
?

0 Likes

#3

This looks great, thanks!
But the command would not be triggered by an event, but directly by me, i.e. by a hotkey.
I could probably start trying to write that plugin if I knew how to retrieve all open filenames (including their paths).
Can you help again?

0 Likes

#4

After a lot of trial and error I finally wrote my first sublime text plugin! :smiley:
I’ll share the code with you on github in a few hours.

0 Likes