EricC
EricC

Reputation: 5870

Perform a script action in the editor

I wonder, is it possible with WebStorm/PhpStorm to perform an action with a own script in the editor? What I want is: I have some text in my web application, I want to make the site i18n, so I will take this text, surround it with some special code (I guess no problem with "Surround with Live Template"), but in addition I want to take this text and automatically put it into a json file for translation (with a special script of my own, to save me from copy the text, switch file, paste and then switch file back). Is this possible?

Upvotes: 0

Views: 92

Answers (1)

lena
lena

Reputation: 93898

You can configure your script as external tool (Settings/External tools) and pass the current file as a parameter to it (using $FileName$ macro, for example). Then you will be able to use menu action/shortcut to run your script for current file from WebStorm/PHPStorm. But this will only work for files, not for selected lines of code. If you miss a possibility to pass a selected block to external tool, please vote for IDEABKL-6913

Upvotes: 1

Related Questions