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

Pulling information from a GB dialog

Engaged ,
Sep 14, 2009 Sep 14, 2009

I have an action where I run a Gaussian Blur 3 times on 3 separate layers. The first blur I have to manually choose based on the image how much blur to set. For the second blur, it is half of the first. For the third, it is half of the second. Is there a way to script in the second and third blurs so they can automatically be applied? Basically, is there a way to grab the amount of blur added to a layer with a script so I can use it in subsequent blurs? Or, can anyone think of a workaround for this?

Part of the issue is that I never know before running the GB dialog how much blur I need to add. It is adjusted based on how it looks.

TOPICS
Actions and scripting
786
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

correct answers 1 Correct answer

Guru , Sep 14, 2009 Sep 14, 2009

These functions should let you do want you need.

function getUserGaussianBlur() {
    var res = -1;
    try{
        desc = executeAction( charIDToTypeID('GsnB'), undefined, DialogModes.ALL );
        if(desc.hasKey(charIDToTypeID('Rds '))){
            res = desc.getUnitDoubleValue(charIDToTypeID('Rds '));
        }
    }catch(e){}
    return res;
}
function gaussianBlur( blur ) {
    if( blur != undefined ){
        try{
            var desc = new ActionDescriptor();
            desc.putUnitDouble( charIDToT

...
Translate
Adobe
Guru ,
Sep 14, 2009 Sep 14, 2009

These functions should let you do want you need.

function getUserGaussianBlur() {
    var res = -1;
    try{
        desc = executeAction( charIDToTypeID('GsnB'), undefined, DialogModes.ALL );
        if(desc.hasKey(charIDToTypeID('Rds '))){
            res = desc.getUnitDoubleValue(charIDToTypeID('Rds '));
        }
    }catch(e){}
    return res;
}
function gaussianBlur( blur ) {
    if( blur != undefined ){
        try{
            var desc = new ActionDescriptor();
            desc.putUnitDouble( charIDToTypeID('Rds '), charIDToTypeID('#Pxl'), blur );
            executeAction( charIDToTypeID('GsnB'), desc, DialogModes.NO );
        }catch(e){}
    }
}

var b = getUserGaussianBlur();
alert( b );
if( b != -1 ) gaussianBlur( b/2 );

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
Engaged ,
Sep 14, 2009 Sep 14, 2009
LATEST

Perfect. Once again, thank you Michael.

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