Skip to main content
Known Participant
February 14, 2019
Question

Can't execute action of event 'toolModalStateChanged' in Photoshop CC 2019

  • February 14, 2019
  • 1 reply
  • 1516 views

Hello,

I trying to play a recorded script using 'ScriptingListener.plugin' to select, duplicate and move a layer using 'move' tool with 'Alt' option.

The 'ScriptingListenerJS.log' file give to actions:

// =======================================================

var idtoolModalStateChanged = stringIDToTypeID( "toolModalStateChanged" );

    var desc5 = new ActionDescriptor();

    var idLvl = charIDToTypeID( "Lvl " );

    desc5.putInteger( idLvl, 1 );

    var idStte = charIDToTypeID( "Stte" );

    var idStte = charIDToTypeID( "Stte" );

    var identer = stringIDToTypeID( "enter" );

    desc5.putEnumerated( idStte, idStte, identer );

    var idTool = charIDToTypeID( "Tool" );

        var desc6 = new ActionDescriptor();

        var idIdnt = charIDToTypeID( "Idnt" );

        desc6.putString( idIdnt, """arwT""" );

        var idTtl = charIDToTypeID( "Ttl " );

        desc6.putString( idTtl, """Herramienta Mover""" );

    var idTool = charIDToTypeID( "Tool" );

    desc5.putObject( idTool, idTool, desc6 );

    var idKnd = charIDToTypeID( "Knd " );

    var idKnd = charIDToTypeID( "Knd " );

    var idmouse = stringIDToTypeID( "mouse" );

    desc5.putEnumerated( idKnd, idKnd, idmouse );

    var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );

    desc5.putBoolean( idkcanDispatchWhileModal, true );

executeAction( idtoolModalStateChanged, desc5, DialogModes.NO );

// =======================================================

var idtoolModalStateChanged = stringIDToTypeID( "toolModalStateChanged" );

    var desc7 = new ActionDescriptor();

    var idLvl = charIDToTypeID( "Lvl " );

    desc7.putInteger( idLvl, 0 );

    var idStte = charIDToTypeID( "Stte" );

    var idStte = charIDToTypeID( "Stte" );

    var idexit = stringIDToTypeID( "exit" );

    desc7.putEnumerated( idStte, idStte, idexit );

    var idTool = charIDToTypeID( "Tool" );

        var desc8 = new ActionDescriptor();

        var idIdnt = charIDToTypeID( "Idnt" );

        desc8.putString( idIdnt, """arwT""" );

        var idTtl = charIDToTypeID( "Ttl " );

        desc8.putString( idTtl, """Herramienta Mover""" );

    var idTool = charIDToTypeID( "Tool" );

    desc7.putObject( idTool, idTool, desc8 );

    var idKnd = charIDToTypeID( "Knd " );

    var idKnd = charIDToTypeID( "Knd " );

    var idmouse = stringIDToTypeID( "mouse" );

    desc7.putEnumerated( idKnd, idKnd, idmouse );

    var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );

    desc7.putBoolean( idkcanDispatchWhileModal, true );

executeAction( idtoolModalStateChanged, desc7, DialogModes.NO );

If I play this actions in 'ExtendScript Toolkit' I get a error on executeAction.

Also I tried to convert the script as C function in a Automation plugin with the same result.

There is no way to play a 'toolModalStateChanged' event?

This topic has been closed for replies.

1 reply

Jarda Bereza
Inspiring
February 14, 2019

This event is read-only. It can't be played.

Tom Ruark
Inspiring
February 14, 2019

Unfortunately, this noise, is to support some other features that need to track if the app is in a modal state. Much to my protest. What I can do is change ScriptListener to ignore those events. Maybe I should add that as an option you can set in the plugin.