Home Download Buy Blog Forum Support

Open all ST opened files in external application

Open all ST opened files in external application

Postby chmielot on Fri Aug 09, 2013 2:43 pm

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
chmielot
 
Posts: 5
Joined: Fri Aug 09, 2013 2:37 pm

Re: Open all ST opened files in external application

Postby adzenith on Sat Aug 10, 2013 3:24 pm

Something like:

Code: Select all
on_load(view):
  subprocess.popen(['open', '-a', '"Zend Studio"', view.file_name()])

?
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Open all ST opened files in external application

Postby chmielot on Mon Aug 12, 2013 7:09 am

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?
chmielot
 
Posts: 5
Joined: Fri Aug 09, 2013 2:37 pm

Re: Open all ST opened files in external application

Postby chmielot on Tue Aug 13, 2013 3:49 pm

After a lot of trial and error I finally wrote my first sublime text plugin! :D
I'll share the code with you on github in a few hours.
chmielot
 
Posts: 5
Joined: Fri Aug 09, 2013 2:37 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests