We've been using the below Java code to set the zoom of a document in Photoshop 7 (yeah, I know - ancient) to fit the screen (like hitting Ctrl + 0 on the PC) but it no longer works in CS6. The runMenuItem command is generating "Error 1242: Illegal argument - argument 1."
function runMenuItem(item){// from xbytor
cTID = function(s) {return charIDToTypeID(s); };
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( cTID( "Mn " ), cTID( "MnIt" ), cTID( item ) );
desc.putReference( cTID( "null" ), ref );
executeAction( cTID( "slct" ), desc, DialogModes.NO );}
runMenuItem("FtOn");// fit on screen ( same as ctrl-0 )
Is there some other way this can to be done in CS6?
Thanks,
Ken