What am I doing wrong here?
Code: Select all
if( strpos(property("#label", "<curpath>"), "red") !=-1) {tag};
Else {tag "red", <curpath>}
Code: Select all
if( strpos(property("#label", "<curpath>"), "red") !=-1) {tag};
Else {tag "red", <curpath>}
So, what should a working script looks like?highend wrote:tag works on the selected item(s) (if you don't provide an item list), and <curpath> isn't the selected item when you're inside of it...
Code: Select all
if (strpos(property("#label", <curpath>), "red") != -1) { tag "", <curpath>; }
else { tag "Red", <curpath>; }
Same issue as mine; It assigns the label if it has no labels before, but it will not remove it if it already has one. Just one way, no Switch behavior.highend wrote:?Code: Select all
if (strpos(property("#label", <curpath>), "red") != -1) { tag "", <curpath>; } else { tag "Red", <curpath>; }
That's exactly what my script does...1- If it has the same label -Red- it should remove it.
2- if it has No-label it should assigns -Red- to it.
3- if it has any other labels it should Replace them with -Red-