Need help to write a script that opens files, removes layers and sous-calques

Hey all,.

I'm a noob to the community of script, and what I try to do is file edit commands that share the same names of layers and sublayers. I have a few questions that would be incredibly useful if I could have answered.

I'm not sure how to define a script too call out of the layers that have been created without script. I need to create a variable for the existing layers and leave the script to know what their names are in the files?

For example, I have three files which have each layer named 'cutlayer', 'trimlayer', 'fold' and 'work '. I need to write a script that opens three files, deletes the layer 'fold' of each file, and then move the layer "trimlayer" in his own sublayer in 'work' (the base layer can be on the top so reorganization sublayers is not necessary to worry about something). I do not understand how to write the script because I couldn't find examples in the documentation for the script provided on the adobe website which has worked with existing files.

It's my shot at what I'm trying to do, with English fill in the blanks of what I do not know how to script. If anyone can help me understand this point, I would really appreciate it!

app.documents.openDlg (prompt, filter, MultiSelect);  the user opens the associated files

If (documents.length > 0) //run the script through each document individually

{

sourceDoc = activeDocument;

delete the "fold" sourceDoc layer

move the "trimlayer" in the layer "work."

remove the underlayment 'path' of layer "work."

Run the script through each document

Save the new file name folder in the new parallel to the current folder on the hard disk

Go out and spend in each document until there is no more

}

create new document

Place documents published in different layers in the new document, with a distance between them, optimize the space on a 51 "x 51" work plan, using as little of the artboard as possible. "

All comments are things basically, I do not know how and am trying to figure out how to do, so if anyone has a second to explain some of these things, I would really appreciate it!

Thanks again!

I know it of very frustrating when his apprenticeship and things don't go as planned, but understand that it is quite confusing as it is and do not add more confusion to the mix by using other tools than those provided. I mean JSLint, it might be useful with GENERAL javascript syntax, but Adobe's Javascript implementation is another animal, or another language, always JavaScript, but intended to be run by its own engine. JSLint has no idea what "layers", or "pathItems" are, it will trigger errors when he sees the objects, it does not recognize.

.. .in learning... not to take baby, write a single line of code and run... If it works, write another line of code

Try this version (always in the ESTK),'re missing you a few "++", and you do not change "documents" with "docs" in a certain place

var docs = File.openDialog("Select Files to Open", "*.ai", true);

var idx = 0;

for (idx = 0; idx < docs.length; ++idx) {

    var doc = app.open(docs[idx]);

    var myCounter = 0;

    for (myCounter = 0; myCounter < doc.layers.length; myCounter++) {

        doc.layers[myCounter].locked = false;

    }

    doc.layers.getByName('Crease').remove();

    doc.layers.getByName('Regmark').remove();

    doc.layers.getByName('Artwork').pathItems[0].remove();

    doc.layers.getByName('Through Cut').hasSelectedArtwork = true;   

    doc.layers.getByName('Through Cut').pathItems[0].strokeColor = doc.swatches.getByName("Black").color;   

    doc.layers.getByName('Through Cut').move(doc.layers.getByName('Artwork'), ElementPlacement.INSIDE);

}

Tags: Illustrator

Similar Questions

  • I need help to write a script that detects the first instance of a paragraph style and then change

    I need help to write a script that detects the first instance of a paragraph style and then he goes to a different paragraph style.  I don't necessarily need someone to write all this, by the biggest problem is to find how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thank you!

    Hello

    then try this with your active doc:

    ....................

    myDoc var = app.activeDocument;

    mStyle var = myDoc.paragraphStyles.item ("PS_NameToFind"); change the name to paraStyle

    var mStyle_1 = myDoc.paragraphStyles.item ("PS_NameToChange"); change the name to paraStyle

    var mFrames = myDoc.pages.everyItem ().textFrames.everyItem () .getElements ();

    app.findTextPreferences = null;

    app.findTextPreferences.appliedParagraphStyle = mStyle;

    for (var k = 0; k)< mframes.length;="">

    {

    currFound = mFrames [k] .findText ();

    If (currFound.length > 0)

    currFound [0] .paragraphs [0] .appliedParagraphStyle = mStyle_1;

    }

    app.findTextPreferences = null;

    ................

    Rgds

  • Hello. I need help developing a PowerCli script that will show me the current configuration of the video Ram of each individual virtual machine on a host\cluster or a vcenter. Can you help me?

    I have a script that will allow me to change the configurations of VRAM, but I need a script that retrieves the configuration of all virtual machines VRAM in my infrastructure.
    I need to get out information to a csv file and run this report on a monthly basis... can you help me?

    Right now my environment is mixed. I have Windows XP virtual machines set to 4 MB, Windows 7 virtual computers set to 8 MB and a subset of sall of virtual machines set to automatic detection of settings.

    I need to be able to recover these settings in a CSV file in order to use this information for comparisons of trdouble-shot performance issues...

    Thank you.

    vram.JPG

    Try something like this

    Get - VM |

    Select Name,

    @{N = "OS"; E={$_. ExtensionData.Config.GuestFullName}},

    @{N = "VideoRamMB"; E = {}

    [math]: Round (($_.)) ExtensionData.Config.Hardware.Device |

    where {$_-is [VMware.Vim.VirtualMachineVideoCard]} |

    (Select VideoRamSizeInKB - ExpandProperty) / 1 Ko, 1).

    }} |

    Export-Csv vm - videoram.csv - NoTypeInformation - UseCulture

  • need help mail from microsoft so that I can use craigslist and chalice

    I tried several different pop address and what not and can't seem to add all accounts and I need to get this set up soon! Help, please!

    http://www.SimpleHelp.NET/2007/02/07/a-beginners-guide-to-setting-up-Windows-Mail/

    Link above has an easy to follow Guide to set up Windows Mail.

    Contact your ISP (Internet Service Provider).

    They offer your broad band/Dial-up connection.

    Ask them to:

    username
    password for your service account to wide band/Dial-Up with them

    Server of incoming POP3 mail
    outgoing mail SMTP server

    The above information is required to set up Windows Mail.

    ISPS are usually happy to help you set up your email account.

    See you soon.

    Mick Murphy - Microsoft partner

  • Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hey ihorl18351266,

    Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.

    Kind regards

    Ana Maria

  • Need help to modify the Script to find the number of vCPU and reservation of memory in VC

    Hello

    Need help to modify the script so that his can person report to the vc all focus level instead of each level of the Cluster.

    Thank you

    KR

    Try this instead:

    $vmsInfo = Get-VM
    #Creating array to place new object
    
    $reportdata = @()
    
    Foreach ($vm in $vmsInfo)
    {
    #Creating new object
    $vmInfo = "" | Select Name, CPUReservationMHz, MemoryReservationGB
    $vmInfo.Name = $vm.Name
    $vmInfo.CPUReservationMHz = $vm.ExtensionData.ResourceConfig.CpuAllocation.Reservation
    $vmInfo.MemoryReservationGB = $vm.ExtensionData.ResourceConfig.MemoryAllocation.Reservation / 1024;
    #Inserting data into new object.
    $reportdata += $vminfo
    }
    $reportdata
    
  • is it possible to write a script that will display the script files folder in the tree

    is it possible to write a script that will display the script files folder in the tree

    Yes :-)

    In your previous post, someone suggested to search for the file "SnpCreateTreeview.jsx", because it would just be the asked.

    The script can be found here, just accept the EULA and download the example scripts of Bridge CS3. (For some reason it is not in CS4 samples because as far as I know)

    Here's a version with small changes, it is up to you to point the script in the folder 'root' right, because this is, needless to C: on PC:

    ////////////////////////////////////////////////////////////////////////////
    ADOBE SYSTEMS INCORPORATED
    Copyright 2007 Adobe Systems Incorporated
    All rights reserved
    //
    NOTE: Adobe permits you to use, modify, and distribute this file according to the
    the terms of the Adobe license agreement accompanying it.  If you received this file from one
    source other than Adobe, then your use, modification or distribution of it is required in advance
    written permission from Adobe.
    /////////////////////////////////////////////////////////////////////////////

    /**
    @fileoverview shows how to use an item in the tree list and how to capture events with
    functions of recall or script registered event listeners.
    @class shows how to use an item in the tree list and how to capture events with
    functions of recall or script registered event listeners.

    Its use


      
      
      

        
    1. Run the extract in the ExtendScript Toolkit (see Readme.txt).
         
    2. Enlarge / reduce the list items
         
    3. Check the JavaScript Console to see the events captured by the elements of the TreeView.
       

    Description


     
     

    Creates two hierarchical list of TreeView items. One is static, with a fixed set of point
    nodes that you can expand and collapse. The other is dynamic; Item nodes are added and removed as
    the need for a view of the file system.
     
     

    The list items in the TreeView control to display the folders and files custom images.  When you add items to the
    TreeView list, type 'article' is used for elements of the leaf and 'node' to the elements of the container.
     
     

    Dynamic TreeView captures events in two different ways. It uses callback functions to capture the
    node to expand and collapse events and selection changes and also registers an event listener to
    capture double-click events.

    @constructor constructor
    */
    #targetengine "session".
    function SnpCreateTreeView()
    {
    /**
    The context in which this code snippet can work.
    @type string
    */
    this.requiredContext = "\tNeed runs in the context of the Bridge\n."

    /**
    The location of this script file system
    @type file
    */
    var scriptsFile = new File($.fileName);
       
    /**
    The location of the file system resource PNG file used to represent folders
    @type file
    */
    this.folderIcon = new file (scriptsFile.path + "/ resources/Folder_16x16.png");

    /**
    The location of the file system resource PNG file used to represent files
    @type file
    */
    this.fileIcon = new file (scriptsFile.path + "/ resources/Story_16x16.png");

    /**
    The root folder that will be used for the dynamic tree
    @type string
    */
    this.rootFolder

    If (File.fs is "Windows")
    {
    this.rootFolder = "C:";
    }
    on the other
    {
    this.rootFolder = ' / ';.
    }
    }

    /**
    Functional part of this code snippet. Creates the ScriptUI window and its components,
    and defines the behavior.
    @return true if the code snippet is executed as scheduled, false otherwise
    Boolean @type
    */
    SnpCreateTreeView.prototype.run = function()
    {

    $.writeln ("about to"run SnpCreateTreeView");
       
    Create the window
    var win = new window ("palette", "SnpCreateTreeView", undefined, {resizable: false});

    Create the Committee for the static TreeView control
    sPanel var = win.add ('Committee', undefined, 'TreeView Élément') static;
    sPanel.alignment = ["fill",""];
    sPanel.alignChildren = ["fill",""]

    Create a TreeView list
    sTv var = sPanel.add ("treeview");
    sTv.preferredSize = (300, 200);
    Add static items to the list, in a hierarchical structure.
    for (var i = 0; i)<>
    {
    sTv.add ("node", "Item" + i);
    for (var j = 0; j)<>
    {
    sTv.items [i] .add ("item", "Sub Item" + j);
    }
    }

    Create the Committee for the dynamic TreeView control
    var dPanel dynamic = win.add ('Committee', undefined, 'TreeView Élément');
    Create a TreeView list
    TV digital var = dPanel.add ("treeview", undefined);
    dTv.preferredSize = (400, 300);
    Create the root node element
    var aNode = dTv.add ("node", "/");
    Pair it with an image of the icon
    aNode.image = this.folderIcon;

    Define a handler for the double clicks
    myOnDoubleClick = Function
    {
    if(e.detail == 2)
    {
    $.writeln ("double click");
    }
    }

    Adds the handler as an event listener to the TreeView element.
    dTv.addEventListener ("click", myOnDoubleClick);

    Keep a reference to this object
    var that = this;

    Define an event handler for when a node is expanded
    dTv.onExpand = function (point)
    {
    $.writeln (item.text + "is now expanded.");
    nextItem var = item;
    var path = "";
    goUp var = true;

    While (goUp)
    {
    path = "/" + nextItem.text + path;
    nextItem = nextItem.parent;
    If (instanceof TreeView nextItem)
    {
    goUp = false;
    }
    }

    Remove all children of this element
    item.removeAll ();

    var Ref = new file (that.rootFolder + path);
    If (Ref instanceof Folder)
    {
    children var = ref.getFiles ();
    for (var i = 0; i)<>
    {
    If (children [i] instanceof file)
    {
    Item.Add ("node", children [i] p:System.NET.mail.MailAddress.DisplayName);
    Item.Items [i] .image = that.folderIcon;
    }
    on the other
    {
    Item.Add ("item", children [i] p:System.NET.mail.MailAddress.DisplayName);
    Item.Items [i] .image = that.fileIcon;
    }
    }
    }
    }

    Define an event handler for when a node is reduced
    dTv.onCollapse = function (point)
    {
    $.writeln (item.text + "is now reduced.");
    }

    Define an event handler for when the selection changes
    dTv.onChange = function()
    {
    $.writeln ("selection changed");
    }

    Display the window
    Win.Show ();
       
    $.writeln ("Ran SnpCreateTreeView");
       
    Returns true;
    }

    /**
    "main program": construct an anonymous instance and run
    as long as we are not unit - test this code snippet.
    */
    If (typeof (SnpCreateTreeView_unitTest) == 'undefined') {}
    new SnpCreateTreeView () .run ();
    }

  • When I opened my computer it always tells me that the file is damaged and unreadable. Please run the Chkdsk utility... I searched my computer for "chkdsk utility" and can't find that. Help, please!

    Can someone help me please, I don't know how to use a computer I was googlen 4 days! When I opened my computer it always tells me that the file is damaged and unreadable. Please run the Chkdsk utility... I searched my computer for "chkdsk utility" and can't find that. Help, please!

    From what you say, you are probably unable to start Windows.

    In this case, when you start the computer, keep tapping the key "F8" on the keyboard until the Advanced menu comes up. Then choose "Safe Mode".

    You will see something like your ordinary, here to enter office "chkdsk volume: /f" (replace with your hard drive volume, in most cases, it's 'c') at the command prompt.

    For reference:

    http://support.Microsoft.com/kb/315265

    Hope this helps

    Post back if necessary

    ____________________

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • media player does not open. Itried the benchmark tool, it did not help. I tried the scanning from the prompt, it says that some files were corrupted and could not repair them. There is no error message at all

    Itried the benchmark tool, it did not help. I tried the scanning from the prompt, it says that some files were corrupted and could not repair them. There is no error message at all

    Maybe the info will offer something that you haven't tried:

    First, launch... Task Manager...

    How to launch the Task Manager instantly in Windows XP or Vista?
    http://www.XP-Vista.com/tipstricks/how-to-launch-the-Task-Manager-instantly-in-Windows-XP-or-Vista

    The Task Manager / processes tab select (highlight) any which instance of:
    "wmplayer.exe" and left click on the button "complete the process".

    If you see a dialog box 'Warning'... left click Yes.

    Close the Task Manager.

    Try Windows Media Player again.

    And... the following links may be worth a visit:

    (925704) when I try to use Windows Media Player 11, the program
    does not start, or some user interface elements are empty
    http://support.Microsoft.com/kb/925704

    Please see the following article for info on opening a high command
    Prompt in Vista

    Windows Vista - command prompt: frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/command-prompt-frequently-asked-questions
    (scroll down to: how to run a command with elevated privileges?)

    Good luck...

  • Can any body help to get a script that can generate the sequence (length 3) with a combination of numbers and characters example: T11... TA1... TZ9... then on

    Can any body help to get a script that can generate the sequence (length 3) with a combination of numbers and characters example: T11... TA1... TZ9... then on

    With the help of the clause type

    Select sqnc

    from (select sqnc

    from (select 'T00"sqnc, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ordr

    of the double

    )

    model

    size of (0 I)

    measures (sqnc, ordr, length (ordr) len)

    rules iterate (1300) until (instr(sqnc[iteration_number],'~')! = 0)

    (sqnc [iteration_number] = case when sqnc [cv (i) - 1] is null

    then sqnc [0]

    of another substr (sqnc [iteration_number - 1], 1, 1) |

    -case when substr (sqnc [iteration_number - 1], 2, 1)<=>

    so when business substr (sqnc [iteration_number - 1], 3, 1)<>

    then substr (ordr [0], instr (ordr [0], substr (sqnc [iteration_number - 1], 2, 1)), 1)

    of another nvl (substr (ordr [0], instr (ordr [0], substr (sqnc [iteration_number - 1], 2, 1)) + 1.1),'~ ')

    end

    end |

    -case when substr (sqnc [iteration_number - 1], 3, 1)<>

    then substr (ordr [0], instr (ordr [0], substr (sqnc [iteration_number - 1], 3, 1)) + 1.1)

    else ' 0'

    end

    end

    )

    )

    where instr(sqnc,'~') = 0

    Concerning

    Etbin

  • Need to call the Shell script that uses SQL loader in APex4.1 / 11g

    Hello!

    I have a requirement in which I need to call a shell script that connects to an external server, FTP to a file and then use sqlloader to load data into our table. We have now the ftp script that accomplishes this task to another program, but is a scheduled task. I wanted to call the script ftp in the APEX. Any suggestions on how this can be done, what is the logic of PL/SQL can we use? I saw online some people using DBMS Scheduler for this?

    Thank you
    Sun

    Hello

    Create some sh script on your computer host oracle where you can join in the external server and run the process.
    something like:

    run_external_sh.sh

    #!/bin/sh
    ssh ext_user@ext_host ./sqlloader/import/import.sh
    

    Then create an external TASK to call it via ORACLE (PL/SQL)

    -Shell Script call.

    BEGIN
      DBMS_SCHEDULER.create_program (
        program_name        => 'external_call_sh',
        program_type        => 'EXECUTABLE',
        program_action      => '/local_host/call_external/sh/run_external_sh.sh',
        number_of_arguments => 0,
        enabled             => TRUE,
        comments            => 'Call external SH script');
    END;
    /
    

    You can now create a regular / or unplanned WORK
    -Job defined by the calendar and an existing program.

    BEGIN
      DBMS_SCHEDULER.create_job (
        job_name      => 'jb_external_call_sh',
        program_name  => 'external_call_sh',
        schedule_name => 'external_call_scheduler', -- created scheduler
        enabled       => TRUE,
        comments      => 'Job defined by an existing external_call_sh program and schedule.');
    END;
    /
    

    You can now call the WORK in the APEX in the process of PL/SQL.

    BEGIN
      -- Run job synchronously.
      DBMS_SCHEDULER.run_job (job_name            => 'jb_external_call_sh');
    END;
    

    Concerning
    J :D

  • Need help to write a sub query

    Our environment - Oracle 10 g

    Hi all
    Need help to write a sub query to reach him here are examples of data using which iam trying to replace the value column in the table based on two other columns in the same table

    Examples of data

    ClaimNo flag LineNo Procedurecode
    100 01 N MN4567
    100 02 Y 7863
    100 03 N MN8976
    100 04 Y 9000
    101 01 Y 8954
    101 02 N MN6754
    101 03 N MN7654
    101 04 Y 8976
    102 01 Y 1234
    102 02 Y 2345
    102 03 Y 3456
    102 03 Y 4567

    Each column of ClaimNo has several rows of data. But if column procedurecode for a claimNo starts with MN then all values associated with the claimno for the flag column should replace N

    If the data must become like below

    ClaimNo flag LineNo Procedurecode
    100 01 N MN4567
    100 02 N 7863
    100 03 N MN8976
    100 04 N 9000
    101 01 N 8954
    101 02 N MN6754
    101 03 N MN7654
    101 04 N 8976
    102 01 Y 1234
    102 02 Y 2345
    102 03 Y 3456
    102 03 Y 4567


    Thank you

    See the example:

    with t as (
                  select 100 ClaimNo, '01' LineNo, 'N' Flag, 'MN4567' Procedurecode from dual
        union all select 100, '02', 'Y', '7863' from dual
        union all select 100, '03', 'N', 'MN8976' from dual
        union all select 100, '04', 'Y', '9000' from dual
        union all select 101, '01', 'Y', '8954' from dual
        union all select 101, '02', 'N', 'MN6754' from dual
        union all select 101, '03', 'N', 'MN7654' from dual
        union all select 101, '04', 'Y', '8976' from dual
        union all select 102, '01', 'Y', '1234' from dual
        union all select 102, '02', 'Y', '2345' from dual
        union all select 102, '03', 'Y', '3456' from dual
        union all select 102, '03', 'Y', '4567' from dual
    )
    select
        claimno,
        lineno,
        flag,
        case
          when count(decode(substr(procedurecode,1,2),'MN',1)) over(partition by claimno)>0
            then 'N'
          else flag
        end new_flag,
        procedurecode
    from t
    

    Kind regards
    Sayan M.

  • Whenever I have download a file, I get a message saying that the file is infected and the virus has been removed but I am unable to open the files.

    original title: problem downloading

    whenever I have download anything download is well over upto100% but the file or the software won't open or saved. It gives the message that this file contains viruses and has been deleted. Please help me find a solution thanks

    I use compaq notebook pesario CQ 60 with pentium dual core inside windows vista AVG anti virus security system

    Hi sirmalik,

    ·         Did you the latest changes on the computer before this problem?

    ·         The problem occurs with all the files?

    ·         From which site you try to download the file?

    ·         What web browser do you use?

    I suggest you follow these methods.

    Method 1: Start the computer in safe mode with network and check if the problem persists.

    http://Windows.Microsoft.com/en-us/Windows-Vista/advanced-startup-options-including-safe-mode

    If the problem does not persist in SafeMode with network, perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After the boot minimum troubleshooting step, follow step 7 in the link provided to return the computer to a Normal startupmode.

    Method 2: Try to create a new user account.

    Create a new user account

    http://Windows.Microsoft.com/en-us/Windows-Vista/create-a-user-account

    If the problem is resolved in a new user account, you can check the link on the way below difficulty a user profile is corrupted.

    http://Windows.Microsoft.com/en-us/Windows-Vista/fix-a-corrupted-user-profile

  • Need help to reactivate Lightroom 5 with my old serial number and the number TAN.  I got a license for Lightroom 5 when I bought my Leica delux 4 in 2012.

    I got a license for Lightroom 5 when I bought my Leica delux 4 in 2012. It worked great, but after that I put an old hard drive on my PC (for 30 minutes - then I removed again) to get some information of this former, Lightroom now license application or try it for 30 days.

    I have not installed Lightroom on a new hard drive. He is always on the same hard disk. How can I now have my Lightroom to run again using my serial number and TAN? Need help to reactivate my old serial number and the number TAN.

    I use win 7.

    Duplicate thread: need help to reactivate Lightroom 5 with my old serial number and the number TAN.  I got a license for Lightroom 5 when I bought my Leica delux 4 in 2012.

  • I NEED HELP Please im having a problem to forget my password and when I plug it it says its locked with a password he try to put the itunes thing but

    NEED HELP Please im having a problem to forget my password and when I plug it it says its locked with a password he tried to put the itunes thing but it says enter password I put in what I rember, then said lokced for five minutes help me pls

    Without knowing the password for your iPhone, there is no way to unlock it, bring even you to the Genius Bar. If you continue to enter the wrong password, you will be locked out of your iPhone, and your data will be unaccessable.

Maybe you are looking for