Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 82585

Re: Move specific path to the top of path palette

$
0
0

It checks if Path name exists and if so, select it and move it to top

executeAction will not send error.

 

myPathNameToTop('Shine');

 

 

function myPathNameToTop(name) {

    $.level =0; // only if you are using this from ESTK (it can be removed when running from photoshop)

    try {

        var myPath = app.activeDocument.pathItems.getByName (name);

    } catch(e) {}

    $.level =1;

    if (String(myPath) != "undefined") { // if exists move to top

        myPath.select();

        var desc25 = new ActionDescriptor();

        var ref23 = new ActionReference();

        ref23.putEnumerated( charIDToTypeID( "Path" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

        desc25.putReference( charIDToTypeID( "null" ), ref23 );

        var ref24 = new ActionReference();

        ref24.putIndex( charIDToTypeID( "indx" ), 0 );

        desc25.putReference( charIDToTypeID( "T   " ), ref24 );

        executeAction( charIDToTypeID( "move" ), desc25, DialogModes.NO );

    }

}


Viewing all articles
Browse latest Browse all 82585

Trending Articles



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