Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I am new to this forum and wanted to just say a quick hello before asking :)

How do I switch the visibility setting of two layers in Illustrator without having to either see both layers visible or none at all as the in-between step? Please see the attached images, hopefully clarifiying the issue.

Sorry if this is trivial, but it's been vexing me a lot!

Thanks

Viktorenter image description here

share|improve this question
    
Hi Viktor, welcome to GDSE and thanks for your question. I rewrote some things so they're a bit clearer. Feel free to re-edit if the text no longer reflects your question--I didn't get what you wanted to achieve at first, so I might be off. –  Vincent Jul 31 at 12:09
    
No, thank you very much... that makes much more sense. Thanks again :) –  krausskopf Jul 31 at 12:40
    
I don't see a way to accomplish this with one step. Layer visibility isn't recordable in an action. The only possible way to do this is with a script, and the script would have to be very specific with layer names. –  Scott Jul 31 at 15:24
    
Yes, @Bakabaka! That's absolutely right. Ooops, it's gone... anyway, you know what I mean :) OK, @Scott, I understand. That's not worth it. I will continue to visually compare the changes by saving a jpg to the desktop and then arrow-key between two images to immediately see the difference... Thanks for your help guys! –  krausskopf Jul 31 at 15:27

1 Answer 1

up vote 2 down vote accepted

Well I have posted a script that could be easily repurposed for this function:

#target illustrator
// Cycle between layervisibility A - B - None - around
// CC BY SA Janne Ojala 2014

layers = app.activeDocument.layers
layer_a = layers.getByName("A") // insert layer names here
layer_b = layers.getByName("B")

if (! layer_a.visible && ! layer_b.visible){
    layer_a.visible =  true;
    layer_b.visible =  false;
} else if ( layer_a.visible && ! layer_b.visible){
    layer_a.visible =  false;
    layer_b.visible =  true;
} else {
    layer_a.visible =  false;
    layer_b.visible =  false;
}

This in general is the benefit of writing scripts when you have a few making the next one becomes easier, and easier. So scripting is one of the easiest ways to increase your personal worth.

share|improve this answer
    
Thank you @joojaa that's way cool! Now I have to post a new question "how to install scripts and use them in Ai"... no, only kidding (I can find out myself) Thanks again! –  krausskopf Aug 1 at 9:01
    
@krausskopf if you find an answer usefull please upvote them otherwise the site does not know that a good usefull answer was given and rank the question and answeree. Also acceot once you have enough answers. Plus it gives you a few badges. –  joojaa Aug 1 at 9:32
    
cool, understood... although I need min. 15 reputation to upvote... I tried :) –  krausskopf Aug 1 at 12:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.