🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #523

JavaScript: Get color of a defined Pixel

#523
From: Andreas_Kr�ger
Date: Tue, 06 Jan 2009 13:44
36 lines
1905 bytes
Hi there,

is it possible to pick the color of a pixel in my document using JavaScript?

For example:
app.activeDocument.pixel.getColor(x,y);

I know this wouldn't work, but is there a chance to do something like this?

I tried to use ScriptingListenerJS Plugin and got the following JavaScript but I don't find any place to give this code the exact pixel I wan't.

var id143 = charIDToTypeID( "setd" );
    var desc26 = new ActionDescriptor();
    var id144 = charIDToTypeID( "null" );
        var ref12 = new ActionReference();
        var id145 = charIDToTypeID( "Clr " );
        var id146 = charIDToTypeID( "FrgC" );
        ref12.putProperty( id145, id146 );
    desc26.putReference( id144, ref12 );
    var id147 = charIDToTypeID( "T " );
        var desc27 = new ActionDescriptor();
        var id148 = charIDToTypeID( "Rd " );
        desc27.putDouble( id148, 22.000000 );
        var id149 = charIDToTypeID( "Grn " );
        desc27.putDouble( id149, 117.003891 );
        var id150 = charIDToTypeID( "Bl " );
        desc27.putDouble( id150, 189.996109 );
    var id151 = charIDToTypeID( "RGBC" );
    desc26.putObject( id147, id151, desc27 );
executeAction( id143, desc26, DialogModes.NO );

Perhaps someone can help me?

BR

Andreas
Technical Details
Message-ID: <59b7700a.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!zen.net.uk!dedekind.zen.co.uk!news4us.nl!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,e4d892495c466347,start
X-Google-Attributes: gidf5839,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Andreas_Kr�ger@adobeforums.com
Newsgroups: adobe.photoshop.scripting
Subject: JavaScript: Get color of a defined Pixel
Message-ID: <59b7700a.-1@webcrossing.la2eafNXanI>
Date: Tue, 6 Jan 2009 05:44:49 -0800
Lines: 40
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!zen.net.uk!dedekind.zen.co.uk!news4us.nl!webcrossing