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

smart filter

Participant ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

I would like to find a way to see if I am
present in an advanced smart filter object

If smart filters are present, everything is ok
if they are not present, a warning is issued.

 

Schermata 2019-11-23 alle 13.28.40.jpg

TOPICS
Actions and scripting

Views

1.6K

Translate

Translate

Report

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 2 Correct answers

People's Champ , Nov 23, 2019 Nov 23, 2019

use function

get_filter_fx_count(layer_id)  

from here https://community.adobe.com/t5/photoshop/photoshop-scripting-update-layers/m-p/9728360#M155634

 

returns 0 if there are no smart filters.

Votes

Translate

Translate
LEGEND , Nov 23, 2019 Nov 23, 2019

Are you serious? Can't you just create if / else statement yourself?

 

alert('SMART FILTER: ' + (executeActionGet(ref).getObjectValue(sTT('smartObject')).hasKey(sTT('filterFX')) ? 'ON' : 'OFF'))

 

Votes

Translate

Translate
Adobe
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

In first description you said something different than in second, so it's not clear for me what you want.

 

Anyway if you want to know if Smart Filters mask is active (ie. not present) then if you work in RGB Mode and all its channels are not deleted then this code should help you (where true is for warning):

 

sTT = stringIDToTypeID; (ref = new ActionReference()).putProperty(sTT('property'), iI = sTT('itemIndex'))
ref.putEnumerated(sTT('channel'), sTT('ordinal'), sTT('targetEnum')), alert(!(executeActionGet(ref).getInteger(iI) > 3))

 

 

 

 

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Kukurykus you are right I did not put the question well
I don't care about the mask

I would just like to know if there are smart filters in the advanced object level or not

so I would like this feature
If smart filters are present, everything is ok
if they are not present, a warning is issued.

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Then false if mask is not present:

 

sTT = stringIDToTypeID; (ref = new ActionReference()).putProperty(sTT('property'), hFM = sTT('hasFilterMask'))
ref.putEnumerated(sTT('layer'), sTT('ordinal'), sTT('targetEnum')), alert(executeActionGet(ref).getBoolean(hFM))

 

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Kukurykus thank you for your efforts but not what I'm looking for

I don't care about the mask if it is present or not present
I'm interested in knowing if smart filters are present

therefore
if there are smart filters, leave everything ok
if no smart filter is present, a warning is issued
alert ("smart filter not present");

 

I thank you again for everything.

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

What is the difference between SmartFilters and FilterMask ?

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

I don't care about the mask
I just want to know if the filters are present

Schermata 2019-11-23 alle 16.44.54.png

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Do you know what is retoricial question?

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

I thank you for your time
good day

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

I think you don't understand 😕

 

When you delete Smart Filters from the layer you showed on the image and run my code (that second), you're getting false. When you still have Smart Filters and run that code you're getting true.

 

So if FilterMask is the same as Smart Filter what I guess you already got your solution?

Votes

Translate

Translate

Report

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
People's Champ ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

you are mistaken

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Okey, it's why I asked what is difference between Smart Filters and FilterMask. If I know that I can know where to start. So what is that difference?

Votes

Translate

Translate

Report

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
People's Champ ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Some stupid questions. Like: what is the difference between a layer mask and a layer?
)
 

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Okey, I don't know, but when I ran that code when Smart Filters is on then I get true, when Smart Filters is not present then false, so if that is not enough to know if Smart Filter is present then I ask what is wrong with that code 🙂

Votes

Translate

Translate

Report

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
People's Champ ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Remove the mask with your hands and run your code)
 

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

The mask from channels?

 

EDIT: okey you are right, I removed the mask from channels and my code doesn't result as true anymore though SmartFilters are present.

Votes

Translate

Translate

Report

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
People's Champ ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

use function

get_filter_fx_count(layer_id)  

from here https://community.adobe.com/t5/photoshop/photoshop-scripting-update-layers/m-p/9728360#M155634

 

returns 0 if there are no smart filters.

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Mr. r-bin
I hope you can help me

My problem is this:
I have many psd files with advanced object layers
some of these have no smart filter inside

So if advanced object has internal smart filter '
Go on
if it has no smart filter it deletes the advanced object level.

Votes

Translate

Translate

Report

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
People's Champ ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Have you tried the advice from the answer above (with reference to the function)?
 

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

btw I ran also your code and it results as true / false depending Smart Filter is avialable, so is there really difference to get to know Smart Filter presence?

 

EDIT: Due to other subthread I tested SmartFilters with deleted mask and in that case scaning Smart Object would be only solution:

 

sTT = stringIDToTypeID; (ref = new ActionReference())
.putProperty(sTT('property'), sTT('smartObject'));
ref.putEnumerated(sTT('layer'), sTT('ordinal'), sTT('targetEnum'))
executeActionGet(ref).getObjectValue(sTT('smartObject')).hasKey(sTT('filterFX'))

 

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Sorry guys
it is I who am unable to understand
because I'm new to scripting
if I was good I wouldn't have asked on the forum
you can post a code that I can use
simply without my interventions

thank you both for your patience with me.

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

If you don't delete masks from Smart Filter you can use my second code. If you do then you should use r-bin code you find in other thread he linked you to. If you still can't realise what is going on over there I updated my previous post with simpler version of his code, however all credits go to him 😉

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Unfortunately it's not what I'm looking for
true and false is not the solution for me
I would prefer this solution more
alert ("smart filter ok");
alert ("smart filter ko");

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Are you serious? Can't you just create if / else statement yourself?

 

alert('SMART FILTER: ' + (executeActionGet(ref).getObjectValue(sTT('smartObject')).hasKey(sTT('filterFX')) ? 'ON' : 'OFF'))

 

Votes

Translate

Translate

Report

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

LATEST

Kukurykus
Gold I understand and it works great
you are a true master
thank you for everything you did for me.

Votes

Translate

Translate

Report

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