Copy link to clipboard
Copied
Hi I would like to script the menu item paste special > Paste in place.
as this all allow the clipboard to paste centrally in the active document?
Many Thanks
Matt
Copy link to clipboard
Copied
You may need to use Action manager code to do that use the Scriptlistener plug-in to generate that code. The is also
runMenuItem (menuID) number Run a menu item given the menu ID
I do know how to get the menuID.....
// =======================================================
var idpast = charIDToTypeID( "past" );
var desc46 = new ActionDescriptor();
var idinPlace = stringIDToTypeID( "inPlace" );
desc46.putBoolean( idinPlace, true );
var idAntA = charIDToTypeID( "AntA" );
var idAnnt = charIDToTypeID( "Annt" );
var idAnno = charIDToTypeID( "Anno" );
desc46.putEnumerated( idAntA, idAnnt, idAnno );
var idAs = charIDToTypeID( "As " );
var idPxel = charIDToTypeID( "Pxel" );
desc46.putClass( idAs, idPxel );
executeAction( idpast, desc46, DialogModes.NO );
Copy link to clipboard
Copied
app.activeDocument.paste(true);
Copy link to clipboard
Copied
Its strange how the human mind works, Well mine anyway. The op stated menu item which set my mind off too quickly I use paste ture all the time.
For example
var selectedRegion = Array(Array(x,y), Array(x+width,y), Array(x+width,y+height), Array(x,y+height));
doc.selection.select(selectedRegion);
doc.paste(true); //paste image into masked layer your document
doc.activeLayer.name=imageName; //label layer with image file name
doc.selection.select(selectedRegion);
align('AdCH'); align('AdCV'); // center what was pasted its size could exceed the area the layer mask will mask over size off
doc.selection.deselect();
Find more inspiration, events, and resources on the new Adobe Community
Explore Now