From 3ef7f62f515e24cb06a870f8f5b536f34cd4de2a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 25 May 2019 02:01:09 +0700 Subject: [PATCH] Added Script.include(String path) convenience extension method / function to make including external scripts easier. --- source/net/filebot/format/ExpressionFormatFunctions.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/net/filebot/format/ExpressionFormatFunctions.java b/source/net/filebot/format/ExpressionFormatFunctions.java index 09b6e7a8..db2ddf5d 100644 --- a/source/net/filebot/format/ExpressionFormatFunctions.java +++ b/source/net/filebot/format/ExpressionFormatFunctions.java @@ -134,6 +134,11 @@ public class ExpressionFormatFunctions { } return f; + + } + + public static Object include(Script context, Object path) throws Exception { + return context.evaluate(getUserFile(context, path)); } private ExpressionFormatFunctions() {