Copy link to clipboard
Copied
hi all !
After installing CC 2015 has stopped working a few scripts. Most need the script to insert the images selected in the Bridge, in the layer with mask.After analyzing the script found a problem - Action-script works in Extend script tool, but doesn't work in html panel. Recorded new script again with the same result - the photo is inserted, resized but is not applied to the mask from the layer. Tell me where to be picked ?
Thanks
This is worked 🙂
var idslct = charIDToTypeID( "slct" );
var desc199 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref181 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref181.putName( idLyr, objDocs.nameShbl);
desc199.putReference( idnull, ref181 );
var idMkVs = charIDToTypeID( "MkVs" );
desc199.putBoolean( idMkVs, false );
var idLyrI = charIDToTypeID( "LyrI" );
var list107 = new ActionList();
list107.pu
Copy link to clipboard
Copied
Supply pertinent information for quicker answers
Copy link to clipboard
Copied
Thanks 🙂
- Adobe Photoshop CC 2015
- Windows 10, 64 bit
- When script is worked in html panel, it`s dont send error.
//-------------------------------------------------
var idMk = charIDToTypeID( "Mk " );
var desc13 = new ActionDescriptor();
var idNw = charIDToTypeID( "Nw " );
var idChnl = charIDToTypeID( "Chnl" );
desc13.putClass( idNw, idChnl );
var idAt = charIDToTypeID( "At " );
var ref10 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idMsk = charIDToTypeID( "Msk " );
ref10.putEnumerated( idChnl, idChnl, idMsk );
var idLyr = charIDToTypeID( "Lyr " );
ref10.putName( idLyr, "IMG_7032" );
desc13.putReference( idAt, ref10 );
var idUsng = charIDToTypeID( "Usng" );
var ref11 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idMsk = charIDToTypeID( "Msk " );
ref11.putEnumerated( idChnl, idChnl, idMsk );
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref11.putEnumerated( idLyr, idOrdn, idTrgt );
desc13.putReference( idUsng, ref11 );
var idDplc = charIDToTypeID( "Dplc" );
desc13.putBoolean( idDplc, true );
alert('OK')
executeAction( idMk, desc13, DialogModes.NO );
alert(1) // this alert is not show !!!!
And second questen - How don`t linked real name for exampel layers (selected italic font) ?
Copy link to clipboard
Copied
Before asking any question you need to explain what you are doing and what the problem is. Scriptlistener code is nothing more than a hard coded actions steps and the recorded code is not really that readable without knowing the Photoshop function the code was record for. Scriptlistener code is also not that useful in Photoshop without modifying it by adding variables into the code and making functions for its use so you can work with other then what the code was recorded for. Do you always want to do the same layer with the same mask. If the document is changes and that layer does not exist the code that did work will fail and when the code executed the action step with an executeAction(); statement it will fail and you will get and error message.
Adobe Photoshop DOM does not cover all of Photoshop functions. All that Photoshop can do, can not be done using Adobe's scripting DOM. Some thing the can not be done using DOM can be done using Action Manager scripting code but again all thing the you can do in Photoshop can not be recorded. Some things that can not be recorded in actions can be inserted into actions and can also be used in Photoshop scripts. Still there as things you can do in Photoshop that can not be automated with scripts and actions.
Copy link to clipboard
Copied
Thanks for the reply
Have an open Photoshop document. He's got 1 layer - an arbitrary rectangle, with the usual layer mask. 2 layer - inserted and already resize the image to which you want to apply the mask with 1 layer.
Copy link to clipboard
Copied
The way you write it sound like you do not know how to explain what you are trying to do in Photoshop you do no describe the steps you are using to do what ever you want to do. You can add layers and layer mask with photoshop scripting. Here is a video that shoen one of my collage script in action. In the video yoy will see five layers added to a template docment ana have layers masks added the the five added layers.
Copy link to clipboard
Copied
and where can I see this script ?
Copy link to clipboard
Copied
Been posted many times. The download link is in the documentation link
Photo Collage Toolkit
Photoshop scripting is powerful and I believe this package demonstrates this A video showing a 5 image collage PSD template being populated with images:
The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
There are fifteen scripts in this package they provide the following functions:
Copy link to clipboard
Copied
This is worked 🙂
var idslct = charIDToTypeID( "slct" );
var desc199 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref181 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref181.putName( idLyr, objDocs.nameShbl);
desc199.putReference( idnull, ref181 );
var idMkVs = charIDToTypeID( "MkVs" );
desc199.putBoolean( idMkVs, false );
var idLyrI = charIDToTypeID( "LyrI" );
var list107 = new ActionList();
list107.putInteger( 85 );
desc199.putList( idLyrI, list107 );
executeAction( idslct, desc199, DialogModes.NO );
// =======================================================
var idMk = charIDToTypeID( "Mk " );
var desc200 = new ActionDescriptor();
var idNw = charIDToTypeID( "Nw " );
var idChnl = charIDToTypeID( "Chnl" );
desc200.putClass( idNw, idChnl );
var idAt = charIDToTypeID( "At " );
var ref182 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idMsk = charIDToTypeID( "Msk " );
ref182.putEnumerated( idChnl, idChnl, idMsk );
var idLyr = charIDToTypeID( "Lyr " );
ref182.putName( idLyr, objDocs.shortName );
desc200.putReference( idAt, ref182 );
var idUsng = charIDToTypeID( "Usng" );
var ref183 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idChnl = charIDToTypeID( "Chnl" );
var idMsk = charIDToTypeID( "Msk " );
ref183.putEnumerated( idChnl, idChnl, idMsk );
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref183.putEnumerated( idLyr, idOrdn, idTrgt );
desc200.putReference( idUsng, ref183 );
executeAction( idMk, desc200, DialogModes.NO );
// =======================================================
var idDlt = charIDToTypeID( "Dlt " );
var desc201 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref184 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref184.putEnumerated( idLyr, idOrdn, idTrgt );
desc201.putReference( idnull, ref184 );
var idLyrI = charIDToTypeID( "LyrI" );
var list108 = new ActionList();
list108.putInteger( 85 );
desc201.putList( idLyrI, list108 );
executeAction( idDlt, desc201, DialogModes.NO );
}