Hello,
it seems LastLogEntry.jsx always eats the first letter of the ScriptingListener output.
For instance:
Code: Select allvar idMk = charIDToTypeID( "Mk " );
var desc40 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref41 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref41.putClass( idLyr );
desc40.putReference( idnull, ref41 );
executeAction( idMk, desc40, DialogModes.NO );
becomes
Code: Select allar idMk = charIDToTypeID( "Mk " );
var desc40 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref41 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref41.putClass( idLyr );
desc40.putReference( idnull, ref41 );
executeAction( idMk, desc40, DialogModes.NO );
Digiting the missing letter and then clicking the "Fix" button, gives a similar error:
Code: Select allfunction ftn1() {
function cTID(s) { return app.charIDToTypeID(s); };
function sTID(s) { return app.stringIDToTypeID(s); };
ar undefined = charIDToTypeID( "Mk " ); // missing "v"
var desc40 = new ActionDescriptor();
var ref41 = new ActionReference();
ref41.putClass( cTID('Lyr ') );
desc40.putReference( cTID('null'), ref41 );
executeAction( undefined, desc40, DialogModes.NO );
};
Regards,
Davide
LastLogEntry bug
-
xbytor
LastLogEntry bug
Which version of PS and what OS is this happening on? I just tried CS5/Win7 and CS4/OSX without problems.
I know there's a work-around for a File.readln bug that may be related.
I know there's a work-around for a File.readln bug that may be related.
-
xbytor
LastLogEntry bug
You may have an old version that doesn't have the bug fix. The core function getLastLogEntry should look like this:
Code: Select allStdlib.getLastJSLogEntry = function(fptr) {
if (fptr) {
fptr = Stdlib.convertFptr(fptr);
} else {
fptr = new File("/c/ScriptingListenerJS.log");
if (!fptr.exists) {
Error.runtimeError(Stdlib.IO_ERROR_CODE, "Unable to find SLC log.");
}
}
fptr.open("r", "TEXT", "????") || throwFileError(fptr, "Unable to open");
//fptr.lineFeed = "unix";
fptr.seek(1, 2); // start of at the end of the file
var prev = fptr.readch();
for (var i = 2; i < fptr.length; i++) {
fptr.seek(i, 2); // start of at the end of the file
var c = fptr.readch();
if (c == '\n' && prev == '/') {
break;
}
prev = c;
}
if (i == fptr.length && prev != '/') {
return undefined;
}
fptr.readln();
// XXX recheck for CS5+
if (!isCS() && !isCS2() && !isCS3()) {
// XXX There is a bug in CS4 that causes the previous readln to
// read one too many characters. This looks for the bug and works
// around it.
var loc = fptr.tell();
var str = fptr.read();
if (str[0] == 'a') {
fptr.seek(loc-1);
str = fptr.read();
}
} else {
var str = fptr.read();
}
fptr.close();
return str;
};
Check to see if that's what you have. It checks fine on CS5/OSX here.
Code: Select allStdlib.getLastJSLogEntry = function(fptr) {
if (fptr) {
fptr = Stdlib.convertFptr(fptr);
} else {
fptr = new File("/c/ScriptingListenerJS.log");
if (!fptr.exists) {
Error.runtimeError(Stdlib.IO_ERROR_CODE, "Unable to find SLC log.");
}
}
fptr.open("r", "TEXT", "????") || throwFileError(fptr, "Unable to open");
//fptr.lineFeed = "unix";
fptr.seek(1, 2); // start of at the end of the file
var prev = fptr.readch();
for (var i = 2; i < fptr.length; i++) {
fptr.seek(i, 2); // start of at the end of the file
var c = fptr.readch();
if (c == '\n' && prev == '/') {
break;
}
prev = c;
}
if (i == fptr.length && prev != '/') {
return undefined;
}
fptr.readln();
// XXX recheck for CS5+
if (!isCS() && !isCS2() && !isCS3()) {
// XXX There is a bug in CS4 that causes the previous readln to
// read one too many characters. This looks for the bug and works
// around it.
var loc = fptr.tell();
var str = fptr.read();
if (str[0] == 'a') {
fptr.seek(loc-1);
str = fptr.read();
}
} else {
var str = fptr.read();
}
fptr.close();
return str;
};
Check to see if that's what you have. It checks fine on CS5/OSX here.
-
undavide
LastLogEntry bug
Hi,
just installed from here: http://sourceforge.net/projects/ps-scri ... p/download ... p/download
Should be 1.7.5 nevertheless installer says it's version "1.6b2" (and the bug still exists)
Thanks
Davide
just installed from here: http://sourceforge.net/projects/ps-scri ... p/download ... p/download
Should be 1.7.5 nevertheless installer says it's version "1.6b2" (and the bug still exists)
Thanks
Davide
-
xbytor
LastLogEntry bug
I've fixed the problem for CS5 since the last packaged release that I uploaded.
I'll take a snapshot of what is currently laying on my dev disk and put that on sourceforge. It's been a year, after all.
The alternative is to use the CVS repository. It is always relatively up-to-date. It has to be, because I use it myself.
My xtools dev box is a MacPro and I have a local CVS repository there. From there, I check files in to sourceforge.
My other machines get their xtools trees from sourceforge. I eat my own dog food, so to speak. This way, if there
is a problem with the xtools files on sourceforge, I know about it pretty quick.
I'll take a snapshot of what is currently laying on my dev disk and put that on sourceforge. It's been a year, after all.
The alternative is to use the CVS repository. It is always relatively up-to-date. It has to be, because I use it myself.
My xtools dev box is a MacPro and I have a local CVS repository there. From there, I check files in to sourceforge.
My other machines get their xtools trees from sourceforge. I eat my own dog food, so to speak. This way, if there
is a problem with the xtools files on sourceforge, I know about it pretty quick.
-
undavide
LastLogEntry bug
Hi X,
downloaded and installed from CVS repository - the updated code (while it keeps saying it's v1.6b2 - not an issue at all) works perfectly! And by the way the first variable of the fixed code is no more:
Code: Select allvar undefined
but
Code: Select allvar desc94
or something like this.
Thank you as always!
Davide
downloaded and installed from CVS repository - the updated code (while it keeps saying it's v1.6b2 - not an issue at all) works perfectly! And by the way the first variable of the fixed code is no more:
Code: Select allvar undefined
but
Code: Select allvar desc94
or something like this.
Thank you as always!
Davide
-
xbytor
LastLogEntry bug
it keeps saying it's v1.6b2
I probably need to update the installation script or something...
I probably need to update the installation script or something...