removed endswith

This commit is contained in:
antelle 2021-01-10 09:59:51 +01:00
parent c7574a6b83
commit 5dd0d51514
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ function checkFilePath(path, ext) {
if (!path) {
throw 'File not specified: ' + ext;
}
if (!path.endsWith('.' + ext)) {
if (path.substr(-(ext.length + 1)) !== '.' + ext) {
throw 'Bad file extension: ' + ext + ' (' + path + ')';
}
var file = Application('System Events').files.byName(path);