3

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

4
  • 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, 2014 at 12:09
  • No, thank you very much... that makes much more sense. Thanks again :)
    – krausskopf
    Jul 31, 2014 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, 2014 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, 2014 at 15:27

2 Answers 2

3

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.

3
  • 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, 2014 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, 2014 at 9:32
  • cool, understood... although I need min. 15 reputation to upvote... I tried :)
    – krausskopf
    Aug 1, 2014 at 12:04
0

About 4 years past. But still if there are someone who want to learn that how to do it with Adobe's native way. They can find it:

https://forums.adobe.com/message/9855214#9855214

The following steps may sound pretty complicated, but as you asked for the basic principle you will have to bear the elaboration. In fact, it is a simple procedure and as soon as you have familiarized with it (including setting up custom template files), it is dead easy.

  1. Open a new document and name Layer 1 "Cyan"

  2. Add three main layers and name them "Magenta", "Yellow" and "Black"

  3. On each layer draw a shape and colour it according to the Layer's name.

  4. Save the file as "My_first_Variables.ai"

  5. Target Layer "Cyan" (click the circle at the right hand of the Layer's name)

  6. At the bottom of the Variables Palette click the Make Visibility Dynamic button

Now you've created your first Layers Visibility Variable. Continue with …

  1. Target Layer "Magenta" and click the Make Visibility Dynamic button in the Variables Palette

  2. Target Layer "Yellow" and click the Make Visibility Dynamic button in the Variables Palette

  3. Target Layer "Black" and click the Make Visibility Dynamic button in the Variables Palette

Done. You have created four Layers Visibility Variables. The next step is to define the Data Sets:

  1. Layers Palette: Show Layer "Cyan" and hide all other layers

  2. Variables Palette: Click the Capture Data Set button (the camera icon)

  3. Layers Palette: Show Layer "Magenta" and hide all other layers. Now in the Variables Palette the first Data Set becomes italic, indicating that you can create a new Data Set. So click the Capture Data Set button to define Data Set 2.

  4. Layers Palette: Show Layer "Yellow" and hide all other layers

  5. Variables Palette: Click the Capture Data Set button to create Data Set 3

  6. Show Layer "Black" and hide all other layers. Click the Capture Data Set button to create Data Set 4

  7. Show all layers and click the Capture Data Set button to create Data Set 5

Done. You have created five Data Sets. Just play arround by toggling them in the Variables Palette (Next/Previous Data Set button or via Popup menu/Flyout menu) and notice one feature among other things: The Variables Palette as a remote control of the Layers Palette. If you like, rename the Data Sets according to the Layers names, for instance.

By the way, showing the Next/Previous Data Set is actionable (that is, a shortcut can be assigned).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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