-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSAccess.jsx
29 lines (24 loc) · 854 Bytes
/
FSAccess.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// asks the user to turn on "Allow Scripts to Write Files and Access Network" in Ae settings
var $FSAccessValidator = function(options) {
#include './UI/window.jsx';
this.conditionWithPalette = function(grantedCallback, options) {
if (this.hasAccessToFilesAndNetwork()) {
if (grantedCallback && typeof grantedCallback == "function") {
grantedCallback();
}
return true;
}
makePalette(this, grantedCallback, options);
}
this.hasAccessToFilesAndNetwork = function() {
try {
var securitySetting = app.preferences.getPrefAsLong(
"Main Pref Section",
"Pref_SCRIPTING_FILE_NETWORK_SECURITY"
);
return securitySetting == 1;
} catch (e) {
return false;
}
}
}