Macros in File Watcher settings
Is it possible to use macros to the define the program a File Watcher should execute?
According to the documentation, it should be possible:
"Click the Insert Macro button to open the Macros dialog box where you can select the relevant macro from the list."
https://www.jetbrains.com/help/pycharm/2017.1/new-watcher-dialog.html#d206311e132
However, there is no "Insert Macro" button and a macro I enter manually does not seem to get evaluated.
I want to run a program that is located in $ProjectFileDir$/node_modules/.bin/eslint

As a workaround, I'm using an absolute path.
I'm using PyCharm 2017.1.2 on Mac OS X 10.12.6, File Watcher plugin version 171.4249.47
Please sign in to leave a comment.
This button has been removed from Program field, as it doesn't make much sense there.
I guess you want IDE project files not to contain your local path to the project to make project shareable, right? You do not need to use macros or do anything at all, this case is handled automatically. In Program field just select full path to the program. You'll see your local path in the dialog, for example,
/foo/bar/myProject/node_modules/.bin/eslint, but if you look inside the.idea/watcherTasks.xmlfile you'll notice that IDE stores this path as"$PROJECT_DIR$//node_modules/.bin/eslint". So you can safely keep.idea/watcherTasks.xmlfile uder Version Control and your colleagues will have the correct path to the program even if local path to project is different.If some path is not within the project, users can define custom Path Variables (Preferences | Appearance & Behavior | Path Variables) and path will be serialized relative to that path.
Macros are designed for a different purpose: to calculate something depending on the current file. In case of File Watchers, it may be, for example, a folder name that contains the file that is currently handled by the File Watcher, or the file name, etc. Macros that do not depend on current file (like the one that you use - $ProjectFileDir$) are not 'standard' in that matter