Bug with Color Halftone Filter

Discussion of actual or possible Photoshop Scripting Bugs, Anomalies and Documentation Errors

Moderators: Kukurykus, Tom, xbytor


Bug with Color Halftone Filter

Post by ddbell »

I ran across I very strange issue with the color halftone filter that I scripted using the script listener.

The color halftone will always use the last values that were used and ignore the values in the script.

Below is a sample script to illustrated the issue. This script should make 2 layers. The first layer should have small black dots. The second layer should have large colored and black dots.

When the script is ran, both layers are identical and will have the small black dots (the value from the first run of the function). Furthermore, if the color halftone filter is used outside of the script prior to running the script then both layers will use those values and not any values from the script. After restarting Photoshop it will use the values from the first color halftone function for both layers again.

I sure hope this issue is isolated to only the color halftone filter. I have well over 100 functions built from the script listener in my script. I am currently testing them 1 by 1 for this bug.

Sample Script:

make_layer ("small black dots");
color_halftone (5,0,0,0,0);
make_layer ("large colored dots");
color_halftone (100,90,180,270,0);

function make_layer ( layername ) {
var id10317 = charIDToTypeID( "Mk " );
var desc1647 = new ActionDescriptor();
var id10318 = charIDToTypeID( "null" );
var ref137 = new ActionReference();
var id10319 = charIDToTypeID( "Lyr " );
ref137.putClass( id10319 );
desc1647.putReference( id10318, ref137 );
var id10320 = charIDToTypeID( "Usng" );
var desc1648 = new ActionDescriptor();
var id10321 = charIDToTypeID( "Nm " );
desc1648.putString( id10321, layername );
var id10322 = charIDToTypeID( "Lyr " );
desc1647.putObject( id10320, id10322, desc1648 );
executeAction( id10317, desc1647, DialogModes.NO );

function fill_gray() {
var id3584 = charIDToTypeID( "Fl " );
var desc596 = new ActionDescriptor();
var id3585 = charIDToTypeID( "Usng" );
var id3586 = charIDToTypeID( "FlCn" );
var id3587 = charIDToTypeID( "Gry " );
desc596.putEnumerated( id3585, id3586, id3587 );
var id3588 = charIDToTypeID( "Opct" );
var id3589 = charIDToTypeID( "#Prc" );
desc596.putUnitDouble( id3588, id3589, 100.000000 );
var id3590 = charIDToTypeID( "Md " );
var id3591 = charIDToTypeID( "BlnM" );
var id3592 = charIDToTypeID( "Nrml" );
desc596.putEnumerated( id3590, id3591, id3592 );
executeAction( id3584, desc596, DialogModes.NO );

function color_halftone ( radius, angle1, angle2, angle3, angle4 ) {
var id3593 = charIDToTypeID( "ClrH" );
var desc597 = new ActionDescriptor();
var id3594 = charIDToTypeID( "Rds " );
desc597.putInteger( id3594, radius );
var id3595 = charIDToTypeID( "Ang1" );
desc597.putInteger( id3595, angle1 );
var id3596 = charIDToTypeID( "Ang2" );
desc597.putInteger( id3596, angle2 );
var id3597 = charIDToTypeID( "Ang3" );
desc597.putInteger( id3597, angle3 );
var id3598 = charIDToTypeID( "Ang4" );
desc597.putInteger( id3598, angle4 );
executeAction( id3593, desc597, DialogModes.NO );