Copy link to clipboard
Copied
Hello fellow extendscript coders.
I am using the json2.js library as advised here:
https://community.adobe.com/t5/animate/json-parsing-issue-object-object/td-p/9868114?page=1
var seqObj = {
items:{
"1be20ac4-6d42-46be-91e3-896e9f3ae3c3":{
end: {seconds: 8.47513333333334, ticks: 2152819468800},
fps: 59.9400599400599,
inPoint: {seconds: 0, ticks: 0},
mediaPath:"",
name: "MVI_1599.MP4",
numTracks: 5,
outPoint: {seconds: 8.47513333333334, ticks: 2152819468800},
shaky: false,
start: {seconds: 0, ticks: 0},
trackIndex: 0,
uuid: "1be20ac4-6d42-46be-91e3-896e9f3ae3c3"
},
"c0dbc73f-8e7a-4f32-bc73-bfbf6478d1a0":{
end: {seconds: 73.02295, ticks: "18548997667200"},
fps: 29.97002997003,
inPoint: {seconds: 0, ticks: "0"},
mediaPath: "",
name: "DJI_0116.MOV",
numTracks: 5,
outPoint: {seconds: 55.2885666666667, ticks: "14044180550400"},
start: {seconds: 17.7343833333333, ticks: "4504817116800"},
trackIndex: 1,
uuid: "c0dbc73f-8e7a-4f32-bc73-bfbf6478d1a0"
}
}
}
createSequenceFromPreset: function (presetPath, seqObj) {
app.enableQE();
seqObj = JSON.parse(seqObj)
return seqData[Object.keys(seqData)[0]]
}
I found the solution here:
I literally had to define the Object.keys function.
This feels like an obsolete and primitive solution but its the only thing I found that worked.
if (!Object.keys) {
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnume...
Copy link to clipboard
Copied
I found the solution here:
I literally had to define the Object.keys function.
This feels like an obsolete and primitive solution but its the only thing I found that worked.
if (!Object.keys) {
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
dontEnumsLength = dontEnums.length;
return function (obj) {
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
throw new TypeError('Object.keys called on non-object');
}
var result = [], prop, i;
for (prop in obj) {
if (hasOwnProperty.call(obj, prop)) {
result.push(prop);
}
}
if (hasDontEnumBug) {
for (i = 0; i < dontEnumsLength; i++) {
if (hasOwnProperty.call(obj, dontEnums)) {
result.push(dontEnums);
}
}
}
return result;
};
}());
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more