Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Paste into place

Contributor ,
Mar 30, 2016 Mar 30, 2016

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

TOPICS
Actions and scripting
442
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 30, 2016 Mar 30, 2016

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 );

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 30, 2016 Mar 30, 2016

app.activeDocument.paste(true);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2016 Mar 30, 2016
LATEST

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();

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines