loop through the layers defining the lock and visibility

I need to loop through the layers in the active document and the value of the properties of the layer is false or true.  I tried to create a loop using a method 'for', but it doesn't seem to work. I have renounced the method 'for' because I kept running into a problem.  I have set all layers with these settings just the odd ones (2,4,6, etc.). Here is sample if it was written.

myLayer = myDoc.layers var [2];

myLayer.visible = false;

myLayer.locked = true;

myLayer = myDoc.layers var [4];

myLayer.visible = false;

myLayer.locked = true;

myLayer = myDoc.layers var [6];

myLayer.visible = false;

myLayer.locked = true;

myLayer = myDoc.layers var [8];

myLayer.visible = false;

myLayer.locked = true;

I have 208 layers, so doing it this way would be way to long. Any help would be appreciated.

Illustrator CC 2014 running.

After I wrote this and tested, I saw that Carlos had already answered, but I thought that I would post it anyway. Carlos KNOWS how much I love JS... ;-)

One difference is that, since it was not clear to me which layer you talk like layer #1, I started at the bottom of the scale.  I hope this helps.  -TT

var aDoc = app.activeDocument;
var lc = aDoc.layers.length;
for (var i = 2; i <= lc; i+=2) {
    var curLayer = lc - i
    aDoc.layers[curLayer].visible = false;
    aDoc.layers[curLayer].locked = true;
}

Tags: Illustrator

Similar Questions

  • To loop through the array and check mouse events

    I have an array of objects. I want to continuously loop in the table and see if the user made a ROLL_OVER or click on one of these objects.

    I regularly did something similar where I loop in a table and look for collisions with a moving object (but who uses hitTestObject: see code below)

    Someone can help me please with how to do the same for the rollover, then click on?

    First of all, a little clean to make it more effective. It is best to declare variables once. If for you the current code I would as follows:

    var k: uint;
    var classRef_mybooth: Class;
    var MC_mybooth: *;
    for (k = 0; k< xmldata.booth_data.length();="" k++)="">
    class classRef_mybooth = getDefinitionByName(xmldata.booth_data[k].@asset);
    MC_mybooth = new classRef_mybooth ();
    MC_mybooth. Name=XMLDATA.booth_data[k].@name;
    MC_mybooth.x=XMLDATA.booth_data[k].@XPos;
    MC_mybooth.y=XMLDATA.booth_data[k].@yPos;
    MC_mybooth. Width=XMLDATA.booth_data[k].@XScale;
    MC_mybooth. Height=XMLDATA.booth_data[k].@yscale;
    MC_mybooth. Number=XMLDATA.booth_data[k].@number;
    boothArray.push (MC_mybooth);
    MC_booth_holder. AddChild (MC_mybooth);
    }

    Second, I guess that all classes whose names in XML are available for Flash (imported, etc.)

    Now, I add a listener that is unique to all of the objects and then do what I do with them based on the target of the event:

    inside the loop on each iteration:

    MC_mybooth.addEventListener (MouseEvent.ROLL_OVER, rollOverListener);

    Later:

    function rollOverListener(e:MouseEvent):void {}
    trace (e.Target.Name); or whatever the variables that you can use. Your target is the object that they roll.
    return;
    }

    Is this what you need?

  • In a table - looping through the rows and the stored procedure call

    APEX version: 3.2.0.00.27

    Hello

    I searched the forum and tried a few things but could not make it work.

    I have a tabular presentation, developed with the help of the ATD (Cascading LOV - method of tabular presentation - AJAX - ATD )

    What I'm trying to do now:
    -After submit and validations, loop through all the lines and
    -call a stored procedure passing 3 parameters obtained from each of the lines on the form of tables. This procedure will be an update of a database table.

    On the forum, I found that I could do the loop "* FOR i IN 1..." APEX_APPLICATION.g_f03. "LOOP COUNT *" syntax.

    Only for testing purposes, I tried just to view information with the following (On Load - after a footer) process (example of Denes Kubicek == > http://deneskubicek.blogspot.com/2009/05/execute-javascript-throuhg-plsql.html):
    declare
      v_today  varchar2 (200);
    begin
    --  :P40_test := APEX_APPLICATION.g_f03(1);
    --  :P40_test2 := APEX_APPLICATION.g_f04.COUNT;
      :P40_test2 := 100;
    
      v_today := to_char (sysdate, 'dd.mm.yyyy');
    
    --FOR i IN 1.. APEX_APPLICATION.g_f03.COUNT LOOP 
    
      :P40_test := APEX_APPLICATION.g_f02(2);
    
      HTP.p ('<script type="text/javascript">');
      HTP.p (   'alert(''Today is '
              || v_today
    --          || APEX_APPLICATION.g_f04(APEX_APPLICATION.g_f03(i))
              || '.\n'
              || 'end!'');'
             );
      HTP.p ('</script>');
    
    --    :P40_test := APEX_APPLICATION.g_f02(APEX_APPLICATION.g_f02(i));
    
    --END LOOP;
    
    end;
    The foregoing would give me a ' * ORA-01403: no data found * ' message. I tried through various variants of APEX_APPLICATION.g_f0* #*, but still can't get anything to display correctly. In commenting on all the lines referring to APEX_APPLICATION.g_f0x above, the date would be are they displayed fine.

    I tried uncomment the FOR... LOOP and play with the code (defining the process runs "On submit - after calculations" and Validations), I got was a ' * ORA-06502: PL/SQL: digital error or value: character conversion number error * "message.

    Here is the script of the form in a table:
    select 
    "V"."MSLINK",                                       -- hidden (number)
    "V"."INSTALLATION_DATE",                        -- editable date picker
    "V"."MANUFACTURER_INDICATOR",              -- editable (cascading LOV -- text)
    "V"."MODEL_INDICATOR",                           -- editable (cascading LOV -- text)
    "V"."DIAMETER_INDICATOR",                      -- editable (LOV -- number)
    "V"."PURPOSE_INDICATOR",                        -- editable (LOV -- text)
    "V"."VALVE_NUMBER",                                -- shown but not editable -- number
    "V"."MODIFY_DATE",                                  -- shown but not editable
    "V"."MODIFY_USER",                                   -- shown but not editable
    "V"."VALVES_STYLE"."FEATURE"                  -- shown but not editable -- number
    from "#OWNER#"."VALVES" "V"
    Where
      "V"."PROJECT_ID" = :P1_PROJECT_NUMBER AND
      "V"."VALVES_DFLAG" = 0
    Regarding the parameters for the stored procedure, it would the MSLINK, VALVE_NUMBER and the VALVES_STYLE. FEATURE.

    Help, please!
    (Sorry for the long post).

    Thank you

    Tan

    Hi, Tan,

    I have not seen that type of object - I've only used custom types for purposes of test years ago and have never used their within Apex!

    One possibility is that the value of checksum being is based on all of the content of these fields, rather than only the part of the FEATURE. If there are other parts of the object, you could include those items as well.

    Otherwise, as you f01 KP for a record, you will need to retrieve the values of the FUNCTION in your PL/SQL code directly from the table (because the user cannot modify these fields, you can be sure that the values in the table will be still valid).

    Andy

  • To loop through the table and use the values returned in another query

    Hello

    I tried to do something very simple, but still can not.

    I am trying to iterate on a table and use each line of a column in a where clause to display a query clause.

    For example:

    I want to retrieve all users of dba_users pass it to a clause where clause in a query to show for example account_status and profile of each user. But I want to do it in a way if I can turn the result in an html table.

    I tried too much really, so I'll post something that does not work, but which I think will show the problem I have,

    BEGIN
     FOR i IN (SELECT username from dba_users order by 1)
     LOOP
     EXECUTE IMMEDIATE 'select account_status from dba_users where username like ''||i.username||''';
     END LOOP;
     END;
     /
    

    Example of what I want to achieve:

    Suppose that there are two users, SYS, and SCOTT:

    USERNAME                       PROFILE                        ACCOUNT_STATUS
    ------------------------------ ------------------------------ --------------------------------
    SYS                            DEFAULT                        OPEN
    
    
    USERNAME                       PROFILE                        ACCOUNT_STATUS
    ------------------------------ ------------------------------ --------------------------------
    SCOTT                            DEFAULT                        OPEN
    

    Thanks in advance for your time,

    OD

    Hi Bill,

    Bill Citad kirjoitti:

    What a join or a sub query going to help me? honestly

    -- join
    select
      s.sql_id,
      h.loads_total
    from dba_hist_sqlstat h join v$sql s on (
      h.sql_id = s.sql_id
    )
    where rownum < 3
    ;
    
    -- subquery
    select
      sql_id,
      loads_total
    from dba_hist_sqlstat
    where sql_id in (
      select sql_id from v$sql where rownum < 3
    )
    ;
    
    -- correlated subquery
    select
      sql_id,
      loads_total
    from dba_hist_sqlstat
    where exists (
      select null from v$sql where sql_id = dba_hist_sqlstat.sql_id
    )
    and rownum < 3
    ;
    
    -- lateral inline view (12c)
    select
      s.sql_id,
      h.loads_total
    from dba_hist_sqlstat, lateral(
      select sql_id from v$sql where sql_id = h.sql_id
    ) s
    where rownum < 3
    ;
    
  • loop through the list in flex 4

    I want to loop through the list and apply the following code to each button, the checkbox and the descent down in my application

    mouseOver = "animateHover ('theComponentID').

    How is that possible?

    Hello

    This should do what you want, you must add the eventlistener now your animated can be run from the th event handler.

    protected function button1_clickHandler(event:MouseEvent):void

    {

    for (var i: Number = 0; i<>

    {

    var obj:Object = this.getElementAt (i);

    If (flash.utils.getQualifiedClassName (obj) is 'spark.components::Button')

    {

    (obj as Button) .addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    }

    If (flash.utils.getQualifiedClassName (obj) is 'spark.components::CheckBox')

    {

    (obj as CheckBox) .addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    }

    }

    }

    private void onMouseOver(event:MouseEvent):void

    {

    animateHover (event.currentTarget);

    }

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • Loop through the list in flex 4 conclusion d buttons

    Anyone know how to completely recursively loops through the list in flex 4 by pulling the bodies of buttons.  This way I can apply my effects for buttons on the screen at the same time?

    You just create a subclass of button that has the desired effect and use it throughout your application.

    Gordon Smith

    Adobe Flex SDK team

  • Activate both drag the lock and drag three fingers

    I tried to activate the TWO drag the lock AND three sliding your finger on my new MacBook Air shape some time and have not been able to do.

    I have an older MacBook Air and an older iMac and on these two computers, it works (it didn't come pre-loaded with El Capitan, they have been 'improved' to El Capitan).  On both I can drag a window using both drag lock AND drag three fingers.  However, I am unable to do it on this new computer.   Is the any way to implement?

    Any ideas?

    Hi Joel,

    Options to drag in El Capitan are discussed in this resource:

    OS X El Capitan: mouse & Trackpad pane accessibility preferences
    https://support.Apple.com/kb/PH21509?viewlocale=en_US&locale=en_US

    The trackpad options

    Allow drag

    Check the box to be able to drag items.

    To set sliding options, click on the context menu, and then choose an option:

    without slide-Lock: double-tap an item, and drag it without lifting the finger after the second tap. dragging stops immediately when you remove your finger.

    Drag lock: double-tap an item, and drag it without lifting the finger after the second tap. dragging continues when you remove your finger and stops only when you type once the trackpad.

    three fingers slide: move an element with three fingers. dragging stops immediately when you lift your fingers.

    Take care

  • How to play audio through the headphones and computer speakers, at the same time.

    Hey I just need to know how to play sounds through the headphones and speakers. Help

    Depends on your audio device.

    If its edge, while normally when you plug the headset switch will cut off the speakers.

    If you have a USB or Firewire pro device you can listen to your headphones as the signal played through your speakers.

    See you soon,.
    Jerry

  • Audio comes through the speakers and headphones plugged headphones

    Audio sound plays through the headphons and speakers when headphones are connected.

    Any advice appreciated

    Hello again Nervuz,

    Thanks for the quick response!

    Based on the information you have provided, I recommend to uninstall and reinstall the audio driver for your desktop. To do this, please follow this document on follow-up with the IDT High Definition Audio Driverdownload and software uninstaller (Windows 8). If this does not work and you hear again audio to both the speakers and earphones, please follow the next step.

    The next step is to run a diagnostics using Automated Troubleshooting (Windows 8)program. This should help with the audio in question.

    Please re-post with the results of your troubleshooting, and I look forward to your response!

    Concerning

  • Sound comes through the speaker and headphones at the same time

    Why is the sound that passes through the speakers and the headphones simutaneouly?

    Hi MariaDuncan

     

    Are the headphones connected correctly?

    I suggest you refer to the link below and use the provided troubleshooting utility. Check if it lists and solves the problems-

    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-fixing-common-sound-problems

    I hope this helps.

  • Printer goes through the motions, and I get a blank sheet of paper

    Original title: printer does not print

    I checked to make sure that my printer is recognized on my laptop, I went through trouble shotting and also I saw that I print but printer goes through the motions and I get a blank sheet of paper.  is it possible that the ink is dry? I look like I have need ink to be

    Hello

    Thank you for keeping us posted.

    I suggest you to read this article for more information:

    http://h10025.www1.HP.com/ewfrf/wc/document?DocName=c01892627&cc=us&DLC=en&LC=en#N3390

    Hope this information helps.

  • To loop through the block of detail to validate documents

    Hello

    I have a MSDS mater where the detailed form has multiple records.

    A block of Master transfer_date and other columns

    Block of retail has prod_no, prod_transfer_by, prod_transfer_count, prod_transfer_to, comments etc.

    (a) a single rule is that on a single day only 50 transfer of prod_transfer_count a prod_no are allowed by a person (prod_transfer_by).

    If it exceeds, that person should not be allowed to continue.

    (b) there are two other forms which is similar to the following where users are allowed to make transfers of products.

    (c) same prod_no, prod_transfer_by,prod_transfer_count, prod_transfer_to, comments of detail, only rule is 50 transfer of prod_transfer_count must not exceed 50

    Taking into account the above, how can I make a loop on the recordings and whether a person who exceeds prod_transfer_count over 50 (which is available in the database table) to be stopped

    to go further? Master form has an option to save as draft and other users are allowed to enter the details in block of retail. So, then the output of the project above rules should be considered.


    Any help on this is much appreciated.


    Thank you


    Hello

    If I'm not mistaken...

    You declare a function of form such as:

    function get_sumProducts (i_prod_no, , .prod_no%type)

    Return number

    is

    number of v_ret;

    Start

    Start

    Select sum ()

    in v_ret

    Of

    where prod_no = i_prod_no;

    exception

    When no_data_found

    then v_ret: = 0;

    end;

    Return v_ret;

    end;

    Subsequently, you attach this form to your item (non-base) as:

    method of calculation: formula

    Formula: get_sumProducts ()

  • I have Adobe Acrobat Professional 7.0 I want to migrate my new laptop running Windows 7. I downloaded the file 22020134.exe to reinstall it on my new computer and I go through the hops and when I put the serial number, it tells me its invalid.

    I have Adobe Acrobat Professional 7.0 I want to migrate my new laptop running Windows 7. I downloaded the file 22020134.exe to reinstall it on my new computer and I go through the hops and when I put the serial number, it tells me its invalid.

    You're right: 22020134.exe is the download of the installer of my link.  Did you use the serial number on the right of this download link?

  • bug in the lock and send it to 11.1.1.3 Excel?

    Y at - it a bug in the lock and send it to 11.1.1.3 Excel?
    I have two lines in excel as shown:
    After I lock and send, both lines have 177.00. This occurs even if the two lines were separated by other lines of data.
    Thorough review of each Excel cell, I see two single quotes before 360 and 6020 2nd line. the first line 360 has single quote, but there are spaces between the single quote and 360. Here is roughly what I see (this site deleted my spaces, so you won't see space in 360 of the first line and its apostrophe):

    Jan

    ' 360 75 6022 2,424.00
    "360 19" 6022 177.00

    On further testing, I discovered that it was the LACK of apostrophe in CC "19" that caused the problem. It's weird that Essbase does not give an error message complaining that 'not all dimensions' as currently.

    If Essbase is a line in a lock and send that contains invalid members, it will load the last combination of valid membership (with no error, as you have noticed). For this reason, I always do a recovery on the dimension members that I want to load first, because she's going to tell me that the members are not valid. On a copy of the sheet of recovery (set to incorrect member), I'll type then the values I want and then lock and send. In this way, I'm guaranteed to send exactly what I want to send where I want to send it.

    Sabrina

Maybe you are looking for

  • HP Windows 7 unable to upgrade to Windows 10 laptop

    I trust HP for years since we got the first programmable HP hand-helds to JK Gill in 1976. To find out that HP laptop I paid a lot for in 2010 is going to be completely obsolete is too sad for words.  Is there SOLUTION No. at all for my computer?  It

  • HP Pavilion 15-n007sr: hard drive error

    My laptop HP Pavilion 15-n007sr fails to load Windows. I ran diagnostics and got an error. HP UEFI diagnostics for hard drive has failed in the short DST test with failure code rg817g-71s7gs-mfpwxf - t 60, 903. Does this mean I need to replace my har

  • I bought a webcam there is brand new TI conflicted with my nero Media Player

    Yes, I bought a vimicro webcam with construction earlier in the microphone and it seems to be in conflict with my nero Player 5.5 since I received the camera that it affects my sound recording in my media player it's a usb external camera ive tried t

  • Not able to select calculation Variables Manager

    HelloNot able to select any variable with variable selector during the creation of business rule. Variables are available in the Variable DesignerVersion (11.1.2.4).Thank youRiadh

  • ThinkPad T500 Windows 7 32-bit or 64-bit?

    I ordered one think that Pad T500 (with ATI 3650 map) on E - Bay that will be shipped with Windows 7 32 bit and 2 GB of RAM. Can I get a copy of Windows 7 64 bit or is 32 bit pretty good or better? Thank you.