ryantakers
11-14-2009, 09:26 AM
I am writing a script for a photoshop project and i have hit (another) stumbling block.
It seems so simple, yet i cannot figure out what is wrong. Here is the code in question:
if(A == 1||3||5||7||9||11||13||15||17||19||21||23||25||27||29)
{
app.activeDocument.artLayers.getByName ("A1").visible=true;
}
else
{
app.activeDocument.artLayers.getByName ("A1").visible=false;
}
if(A == 2||3||6||7||10||11||14||15||18||19||22||23||26||27||30)
{
app.activeDocument.artLayers.getByName ("A2").visible=true;
}
else
{
app.activeDocument.artLayers.getByName ("A2").visible=false;
}
The problem is that it makes the layers visible regardless of whether the condition is true or not. The problem lays in the condition, not the response, i have narrowed this down.
It shows dots, in binary based on the number input.
Any help would be immensely appreciated.
Regards,
Ryan
It seems so simple, yet i cannot figure out what is wrong. Here is the code in question:
if(A == 1||3||5||7||9||11||13||15||17||19||21||23||25||27||29)
{
app.activeDocument.artLayers.getByName ("A1").visible=true;
}
else
{
app.activeDocument.artLayers.getByName ("A1").visible=false;
}
if(A == 2||3||6||7||10||11||14||15||18||19||22||23||26||27||30)
{
app.activeDocument.artLayers.getByName ("A2").visible=true;
}
else
{
app.activeDocument.artLayers.getByName ("A2").visible=false;
}
The problem is that it makes the layers visible regardless of whether the condition is true or not. The problem lays in the condition, not the response, i have narrowed this down.
It shows dots, in binary based on the number input.
Any help would be immensely appreciated.
Regards,
Ryan