Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Simulate a key press (Javascript)

$
0
0

I don't think JS will let you do that - mainly for security reasons.  They want actual keyboad input.  However, you can record resetting the rotate tool with this code:

 

var idslct = charIDToTypeID( "slct" );

    var desc4 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref3 = new ActionReference();

        var idrotateTool = stringIDToTypeID( "rotateTool" );

        ref3.putClass( idrotateTool );

    desc4.putReference( idnull, ref3 );

    var iddontRecord = stringIDToTypeID( "dontRecord" );

    desc4.putBoolean( iddontRecord, true );

    var idforceNotify = stringIDToTypeID( "forceNotify" );

    desc4.putBoolean( idforceNotify, true );

executeAction( idslct, desc4, DialogModes.NO );


Viewing all articles
Browse latest Browse all 27456


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>