Page 1 of 2

actionstojavascript not working

Posted: Sun Oct 31, 2010 5:23 pm
by rhytha
Hi ,

Thanks for this great tool, first. Its save's 90% of coding work for newbies to PS scripting like me and also provides code which we can learn from.

I converted a action to jsx for more flexiblity, but iam getting the "unknown" command error at Line: 49.

I have attached the jsx file. I have also attached the scriptlogger.log for further assistance on this.

thanks

actionstojavascript not working

Posted: Sun Oct 31, 2010 7:20 pm
by rhytha
I am using PS3, and a third-party plugin called Photo Font to apply a text style on to images in a folder, for further explanation.

thanks for any answers

actionstojavascript not working

Posted: Mon Nov 01, 2010 6:45 pm
by xbytor
I can see where the problem is. Can you email me a copy of the action that you are trying to translate so I have something to test with?

actionstojavascript not working

Posted: Sat Nov 06, 2010 6:38 pm
by rhytha
X Bytor,

Thanks for the script you provided.

In that the txt value we set in the js script is not being picked up by photofont, below is the code xTools is generating.

Code: Select all    desc1.putString(cTID('Txt '), "psscripts");



actionstojavascript not working

Posted: Sat Nov 06, 2010 7:33 pm
by xbytor
Get the ScriptingListener log entry where you invoke the plugin. Modify it with new text and run it.
If it doesn't work, the problem is with the plugin. If it does work, post the SL code here and I'll see what I can do.

actionstojavascript not working

Posted: Mon Nov 08, 2010 9:07 am
by rhytha
The text gets displayed in the plugin input box, but is grabbled.

Like for

A it displays L???d
B it displays l??? e??>

I think these are PostScript chars or something, because when i searched google with these strings, i can see .eps and .ps files listed.

I also tried with putData but same result, but slightly different texts. I have attached the jsx file for reference.

Code: Select all // Photofont Start
  function step3(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
   
    desc1.putString(cTID('Txt '), "B");
   //alert(desc1.getString(cTID('Txt ')));
    desc1.putString(cTID('FntN'), "TEST3");
   //alert(desc1.getString(cTID('FntN')));
    desc1.putInteger(cTID('Hght'), 72);
   //alert(desc1.getString(cTID('Hght')));
    executeAction(1885881905, desc1, dialogMode);
  };


actionstojavascript not working

Posted: Mon Nov 08, 2010 8:04 pm
by xbytor
I need the ScriptingListenerJS.log file that includes an invocation of the plugin. Something is not getting translated correctly.

actionstojavascript not working

Posted: Mon Nov 08, 2010 9:13 pm
by rhytha
I have attached the log file for your refernce

thank you for your time.

actionstojavascript not working

Posted: Mon Nov 08, 2010 10:05 pm
by xbytor
Just put this in a new jsx file, execute it, and let me know if it works.

Code: Select all// =======================================================
var id1 = charIDToTypeID( "Opn " );
    var desc1 = new ActionDescriptor();
    var id2 = charIDToTypeID( "null" );
    desc1.putPath( id2, new File( "C:\\Documents and Settings\\Raji\\My Documents\\Photofonts\\input_file.jpg" ) );
executeAction( id1, desc1, DialogModes.NO );

// =======================================================
var id3 = charIDToTypeID( "phF1" );
    var desc2 = new ActionDescriptor();
    var id4 = charIDToTypeID( "Txt " );
    desc2.putString( id4, "P" );
    var id5 = charIDToTypeID( "FntN" );
    desc2.putString( id5, "ChocolateCream72" );
    var id6 = charIDToTypeID( "Hght" );
    desc2.putInteger( id6, 48 );
executeAction( id3, desc2, DialogModes.NO );

actionstojavascript not working

Posted: Tue Nov 09, 2010 8:17 am
by rhytha
I changed a little for the plugin to popup, since the code you pasted did'nt make it pop-up.

But the text and font are grabbled, while the font size did come out correctly.

I have extendedscript toolkit2 , do you want any specific info from that for debugging.

Code: Select all// Photofont Start
  function step3(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var id4 = charIDToTypeID( "Txt " );
    desc1.putString( id4, "123123" );
    var id5 = charIDToTypeID( "FntN" );
    desc1.putString( id5, "TEST3" );
    var id6 = charIDToTypeID( "Hght" );
    desc1.putInteger( id6, 150 );
//    desc1.putString(cTID('Txt '), "B");
   //alert(desc1.getString(cTID('Txt ')));
   // desc1.putString(cTID('FntN'), "TEST3");
   //alert(desc1.getString(cTID('FntN')));
    //desc1.putInteger(cTID('Hght'), 48);
   //alert(desc1.getString(cTID('Hght')));
    executeAction(1885881905, desc1, dialogMode);
  };



thanks for helping me out.