Search code examples
phpstorm

PhpStorm: how to apply external tool (jpegoptim) on many files?


I am using jpegoptim in PhpStorm as external tool.

Works fine when I do select 1 file.

How can I apply that on many JPEG files ? enter image description here


Solution

  • That's not possible at the moment (not supported).

    Watch these tickets (star/vote/comment) to get notified on any progress.


    If you definitely need it in one go (and not calling that External Tools entry once for each file)... then what you may try is:

    • Select desired files
    • Use Copy Paths from context menu
    • Call another External Tools entry that:

      1. Uses $ClipboardContent$ macro
      2. It's some shell/batch script that parses such parameter (splits into separate lines to get individual paths) and then calls actual program in cycle -- once for each file from the parsed parameter.

    A bit too complicated as for my liking... Plus, I've not tried it myself so not sure how line ending symbols will be passed here (so it can be parsed in the script).


    BTW -- you can assign custom shortcut to particular External Tools entry so you may call it for each file individually -- it will be faster with shortcut than doing the same with the mouse.