Page 1 of 1

[tip] Run script on file save

Posted: 17 Jul 2013 18:16
by pjj
In the latest version (8.6x) Rickard introduced really great feature: run script on file save. It may be used for a panoply of actions, among them for building target files from source files, e.g. building one CSS files from many SASS/SCSS files (this is what I do, anyway.) I hope the snippet below will save you five minutes needed to make it up:

Code: Select all

// find extension
dotPosition = ScriptUtils.WRightPos(".", Document.FileName);
extension = copy(Document.FileName, dotPosition + 1, Length(Document.FileName) - dotPosition);

if (extension == "scss") {
 // do what you need to do with .scss files here