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

Scripting New "Rasterize Layer Style" feature of Photoshop CS6

New Here ,
Jun 16, 2012 Jun 16, 2012

I want to script new feature added to Photoshop CS6 "Rasterize Layer Style". I tried Layer.RasterizeLayerStyle() but this function doesn't exist.

I know that I still can add an empty layer below the layer and merge them together, but it would be much easier and the code would be more readable if I can use "Rasterize Layer Style" command in my script.

TOPICS
Actions and scripting
6.0K
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 ,
Jun 17, 2012 Jun 17, 2012

Did you try installing the optional Scriptlisener Plug-in to see if it recorded anything.   Though Layer>Rastersize>Layer Style is new you could always accomplish what it does other ways.  Like merging visible layers where one layer is empty.  It just rasterize the layer along with its layer style. In fact if the layer in question was a smart object layer after the "Rasterize Layer Style" operation that is exactly whet you will have a raster layer no longer will it be a smart object layer.

Adobe shortchange scripting in CS6 for example you can not read the usere interpolation Photoshop preference if its set to the new default setting Bicubic Automatic and you can not set it to Bicubic Automatic if you read that it is not set to Bicubic Automatic.  Adobe simply dropped the ball and did not add the nessary update to support CS6 new features to scripting and installing the sicptlistner will turn off a new feature like allowing tool recording.  CS6 is by far the buggest release of Photoshop I ever installed. The list of the Photoshop versions I have installed is

PS3

PS5

PS5.5

PS7

CS

CS2

CS3

CS5

CS6

I use CS3. The money I sent upgrading to CS5 and CS6 so far has been a wast of money... Phehaps Adobe will fix the bugs and not deferr them to some future release like they historically do.

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
Community Expert ,
Jun 17, 2012 Jun 17, 2012

Are you familiar with ScriptingListener.plugin?

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

var idrasterizeLayer = stringIDToTypeID( "rasterizeLayer" );

    var desc5 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref4 = new ActionReference();

        var idLyr = charIDToTypeID( "Lyr " );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref4.putEnumerated( idLyr, idOrdn, idTrgt );

    desc5.putReference( idnull, ref4 );

    var idWhat = charIDToTypeID( "What" );

    var idrasterizeItem = stringIDToTypeID( "rasterizeItem" );

    var idlayerStyle = stringIDToTypeID( "layerStyle" );

    desc5.putEnumerated( idWhat, idrasterizeItem, idlayerStyle );

executeAction( idrasterizeLayer, desc5, DialogModes.NO );

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
Participant ,
Jul 26, 2017 Jul 26, 2017

this code select smart objects  layer Only working

how to the all document smart objects to rasterize layer

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 ,
Jul 26, 2017 Jul 26, 2017

That Action manager code most likely rasterizes the current active layer it select nothing on its own.  You would need to loop through a document's layers and use that code for each smart object layer that has a layer style.

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
Community Expert ,
Jul 26, 2017 Jul 26, 2017

Paul Riggott posted code on rasterising all Smart Objects in a file once.

Photoshop: Rasterize all smart objects in a PSD file to shrink down it's size | Photoshop Family Cus...

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
Participant ,
Jul 26, 2017 Jul 26, 2017

yes working thank you very much:)

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 ,
Jul 26, 2017 Jul 26, 2017
LATEST

Be careful with what you do to the layer after they are rasterized the are  no longer smart object layers the objects pixels are now replace with a transform rendering of the original object pixels.  The layers will no longer transform and resize like smart object layers do.

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
Community Expert ,
Jun 17, 2012 Jun 17, 2012

Sometimes the Rasterize Layer Style produces different results than flattening the layer effects: i.e merging with a new empty layer below.

So you might want to verify you get the same results.

One example is if you have a stroke added with the stroke option in the tool options bar and a color overlay in the layer styles dialog.

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