My script works as an action but not as a script
Hi here is the code, it works as an action then when I convert it to script then it just does nothing, this is to go to end of working area in timeline in photoshop
#target photoshop
//
// Set.jsx
//
//
// Generated Thu Aug 23 2018 18:57:29 GMT+0200
//
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
//
//==================== Set ==============
//
function Set() {
// Set
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Prpr'), cTID('time'));
ref1.putClass(sTID("timeline"));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putInteger(sTID("seconds"), 4);
desc2.putInteger(sTID("frame"), 29);
desc2.putDouble(sTID("frameRate"), 30);
desc1.putObject(cTID('T '), sTID("timecode"), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
step1(); // Set
};
//=========================================
// Set.main
//=========================================
//
Set.main = function () {
Set();
};
Set.main();
// EOF
"Set.jsx"
// EOF
