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

Tags: InDesign

Similar Questions

  • 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);
    
    }
    
  • script to duplicate the standard paragraph style, and then change the size of the character point

    I want to create a script that will create a cascade of paragraph based on the style settings [standard paragraph] styles. My goal is to point size of each new paragraph style character as a percentage of the original [standard paragraph]. So if [standard paragraph] is 100% (point character size 10pt), the script would create a paragraph style called 120% ' that has a point size of character of 12 points. Then 133%, 140%, and on and on. I modified a script found on this forum to generate these new styles, but I don't know how to be based on the [standard paragraph]. Any help would be much appreciated, thanks in advance.

    current script:

    var doc = app.activeDocument,

    pStyle = ['100% ', '120% ', '133% '];

    for (var i = 0; i < pstyle.length; i ++)

    {

    If (pstyle [i] is "100 %")

    {

    doc.paragraphStyles.add ({name: pstyle [i], appliedFont: 'Deer', pointSize:10});})

    }

    ElseIf (pstyle [i] == "120 %")

    {

    doc.paragraphStyles.add ({name: pstyle [i], appliedFont: "Deer", pointSize:10 * 1,2})

    }

    ElseIf (pstyle [i] == "133 %")

    {

    doc.paragraphStyles.add ({name: pstyle [i], appliedFont: "Deer", pointSize:10 * 1.33333})

    }

    }

    Try this,

    var doc = app.activeDocument,
        pstyle = ["100%", "120%", "133%" ];
    
    for(var i =0;i
    

    Kind regards

    Cognet

  • After that turn the power off for a few days and then back on... all my desktop ICONS was reorganized.

    After that turn the power off for a few days and then back on... all my desktop ICONS changed. I placed the worms where I want that they and computer restarted and they get rearranged again. Help, please.

    Hello Kenneth Pincus,

    You can create a new profile on the computer and if the desktop icons stay on their position. If this is not the case, the other profile is corrupt. To create a new user profile, you can see the article mentioned below for the procedure.

    How to create and configure user accounts in Windows XP

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

     

    How to copy data from a corrupted to a new profile in Windows XP user profile

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

    Let us know the results.

  • 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

  • Help with a script that detects the content in a cell and apply the cell style to line

    Hello


    I am trying to add an article to my table formatting script that is a cell with the word 'Budget' (but this can be written as ' Budget:' or ' Budget: (E) "- but without the speech marks) and apply the cell Style - SponsorCells - to all the cells of the whole line. I currently have on what it will, but it does not work:


    function checkWhichTable()
    {
    // ensure the user made a selection
    if (app.selection.length != 1)
    return null;
    var currentTable = app.selection[0];
    if (currentTable.hasOwnProperty("baseline"))
    {
    currentTable = app.selection[0].parent;
    }
    while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column)
    currentTable = currentTable.parent;
    if (!(currentTable instanceof Table))
    {
    // No table selected
    return null;
    }
    return currentTable;
    }
    app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table");
    
    
    function checkUserSelection ()
    {
    var a_table = checkWhichTable();
    if (a_table == null)
    {
    if (confirm("No table selected. Do you want to process *all* tables?") == false)
    return;
    allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
    for (aTable=0; aTable<allTables.length; aTable++)
    {
    processTable (allTables[aTable]);
    }
    } else
    {
    processTable (a_table);
    }
    }
    function processTable(table)
    {
    // do something here!
    
    
    //Set 1st Row Height
    table.rows[0].height = "30mm";
    
    
    //Find Text in Cell and apply Cell Style to Row 
    var  
      myCellText=['Budget', 'Budget:', 'Budget: (E)'];  
     var myRegEx = new RegExp("^("+myCellText.join("|")+")$");
      for (i=0; i<table.cells.length; i++)
      {
        if (table.cells[i].texts[0].contents.match(myRegEx))
          table.cell[i].appliedCellStyle = "SponsorCells";
      }
    
    
    //end - do something here!
    }  
    


    I can get the script to apply the cell style to "SponsorCells" for each cell that contain the word 'Budget' etc, but I need cell ever on this line to have the cell style applied. I tried to re-write line 56 which applies the style to a cell, but I can't seem to make it work. Any help would be great.


    Separate on this issue, I would like to have a line of code similar to the 46 line, which sets the 1st height of lines, but I would like to say "If a cell has 'A cell Style' and then applies the value height 10 mm". If someone could result as a help of bonuses, things would be great double.


    Thanks in advance!

    But that could be painfully slow. To speed things up, follow these steps:

    var cells = table.cells.everyItem().getElements();
    for (var i=0; i
    

    It is faster, because it creates an array of cells with a call to table.cells, which is several times faster than calling table.cells. And before assigning to line 12mm height is useful to check if it is already 12 mm. checking things in InDesign and do things only when it is necessary is much more effective than simply doing things even if they are not necessary.

  • Required script - creation of the snapshot, keep for 24 hours, deleted and then repeat

    Looking for a script that will perform the following functions

    (1) create a snapshot of the virtual machine

    (2) keep the snapshot of the machine virtual for a period of 24 hours (or anytime definable)

    (3) remove the snapshot... .Rinse and repeat

    Sort of a "backup" of 24 hours. One of our VMs finance must be able to quickly return to the config of the previous days

    All licensees/aid

    Thanks in advance

    At its very simplest, you could do something in powershell and run every 24 hours on your virtual machine center:

    #Add PowerCLI

    Add-PSSnapin-name 'VMware.VimAutomation.Core '.

    http://Reflection.Assembly: LoadWithPartialName ("vmware.vim")

    $VCServer = "VCServer.

    $VMName = "FinanceVM".

    $SnapName = "NightlyBackupSnap".

    $VM = get-VM-name $VMName

    Remove-Snapshot - Snapshot (Get-Snapshot - name $SnapName - VM $VM) - confirm: $False

    New-Snapshot - VM $VM - name $SnapName - suspend: $True - confirm: $False

  • Need help importing CSV file with commas in the rest of the data

    I have a linux script that gets the CSV files from a remote server and import the data into a table using SQLLoader.

    The problem I have is that the data in the CSV files sometimes contains commas in the text field that is interfering with the import and I have no control over what is in the file.

    my table:

    Create the table my_tab
    * (TIME_STAMP date, *)
    REQUEST_IP varchar2 (30),
    User_id varchar2 (30),
    FACILITY_ID VARCHAR2 (255),
    Number SUBFACILITY_ID,
    DETAIL VARCHAR2 (255)
    *);*

    example of a CSV file:

    * 27032011 story 232708,162.108.20.61,user123,cstmr_view_hlr_history,0,Viewed with 10 results per page for 1234567890 *.
    * 232737,162.108.20.61,user123,cstmr_view_customer,0,Facility 27032011 [display] selected *.
    * 232744,162.108.20.76,user123,cstmr_add_gprs,0,Facility 27032011 [Add x] selected *.
    * 232759,162.108.20.94,user456,cstmr_hlr_request,0,Facility 27032011 [x orders] selected *.
    * 27032011 added 232806,162.108.20.94,user123,cstmr_hlr_request,2,Customer note: note [x], MSISDN [1234567890] *.
    * 232806,162.108.22.96,user789,cstmr_hlr_request,0 27032011, queue update: Action [46], IMSI [1234567890] old [, MSISDN IMSI [1234567890] *.
    * 232815,162.108.20.67,user789,cstmr_view_customer,0,Facility 27032011 [display] selected *.
    * 27032011 232822,162.108.20.67,user123,cstmr_view_customer,5,Screen ' display customer details ': MSISDN [1234567890] *.
    * 27032011 232702,162.108.20.57,user456,cstmr_hlr_request,0,Queue update: Action [45], IMSI [1234567890] old [, MSISDN IMSI [12345678901], AFN [], [PDPREC] *.
    * 27032011 connection 232825,162.169.22.108,user456,adm_login,1,Successful: user [user_name] *.
    * 232829,162.169.22.108,user456,cstmr_view_customer,0,Facility 27032011 [display] selected *.

    How can I get around the commas in the text?

    Published by: cinnamon on April 4, 2011 08:07

    There is a way to do it, but it depends on a few assumptions, and (b) you have to jump through hoops to do it.

    First of all, this only works if there is no comma request_id, user_id or facility_id. (if there is, then you're stuck, because there is no way to determine which commas are part of data and those that are separators.)

    Second, he must know if there are any particular character - say | -who never appears in the detail.

    If you can do both of these assumptions, then what you have to do is:
    (1) create an array that consists of a single VARCHAR2 column large enough to hold longer line of your input data.
    (2) to import your data into this table.
    (3) replace the first five commas in each row of the table with. (or whatever your "unused" character).
    For example:

    UPDATE temp_data_table
    SET row_text = REPLACE(SUBSTR(row_text, 1, INSTR(row_text, ',', 1, 5)), ',', '|') || SUBSTR(row_text,  INSTR(row_text, ',', 1, 5) + 1);
    COMMIT;
    

    (4) write a SQL INSERT command to build your target table according to the values separated by the | characters.

    -Don

  • Need help to optimize this script.

    Hello

    I use ID CS5 on Windows7.

    I have a requirment where I need to type text in a block of text perticular and copied it to any other text frames.

    I wrote this little script that does the job for me.

    It has a few obvious repitations and is ineffective.

    Please help me optimize it.

    myDocument var = app.activeDocument;

    myPage var = myDocument.pages.item (0);

    find a block of text with the title of specific script and store its content in a variable

    for (var i = 0; i < myPage.pageItems.length; i ++)

    {

    currItem = myPage.pageItems.item (i);

    If (currItem.label is "ParentText")

    {

    source var = currItem.contents;

    }

    }

    find all the blocks of text except the text with the title of script block and set its content to the source

    for (var i = 0; i < myPage.pageItems.length; i ++)

    {

    currItem = myPage.pageItems.item (i);

    If (currItem.label! = "ParentText")

    {

    currItem.contents = source;

    }

    }

    Hello

    You could match to your 'model' textFrame using string functions.

    Text operations are faster and there is no need of extra loops:

    var
              mLabel = "ParentText",
              mBreak = ";_;",
              mString = app.activeDocument.textFrames.everyItem().label.join(mBreak ),
              mID = mString.search(mLabel),
              mFrames = app.activeDocument.textFrames.everyItem().getElements(),
              source, k;
    
    if (mID == -1)  { alert ("Desired label not found"); exit(); }
    
    mID = mString.slice(0,mID).split(mBreak).length - 1;
    source = app.activeDocument.textFrames[mID].contents;
    
    for (k = 0; k < mFrames.length; k++)
              if (mFrames[k].label != mLabel)
                        mFrames[k].contents = source;
    

    Arrival to the string table returns a string,

    Search method returns the index

    Slice method cut the string.

    Split method trasforms it back towards the table length (minus 1) is equal to the index of the textFrame.

    The rest is to change the content of the frames inside a loop

    Jarek

  • 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 ();
    }

  • 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 a script that lists the VM with a snapshot

    Hello

    I am relatively new to powershell scripting and even newer to the vSphere CLI. I have no problem reading and understanding scripts, but what makes one is another story. In any case, I'm looking for help to create a script that will check that all the vm's on all ESX hosts, if they have a snapshot and if they echo the name of the virtual machine to the screen.

    That's what I have so far but I'm stuck and probably on the wrong track. Any help/suggestions are welcome!

    $user = "< removed >.
    $passw = "< removed >.
    $VIServers = "< IP ESXi host >", "< IP ESX Host1 >', '< IP ESX Host2 >', '< IP ESX Host3 >', '< IP ESX Host4 >', '< IP ESX Host5 >', '< IP ESX Host6 >.

    {foreach ($VIServer to $ViServers)
    SE connect-VIServer-Server $VIServer - user $user-password $passw
    $vms = get-vmhost $VIServer | Get - vm

    {foreach ($vm to $vms)
    < code that checks to see if there is a snapshot and echo is the name of the virtual machine to the screen. Clueless >

    }
    }
    }

    Forward thanks!

    Kind regards

    Erik

    Why directly to the ESX: you?... To connect to vCenter instead and then it s very easy...

    Get - VM | Get-Snapshot | Select the virtual machine, name, Description, created. Kind created

    Kenth-

  • 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.

  • the friends hyii UA HUD need help how to make a backup of the files from his deleted with (shift + delete) memory card

    the friends hyii UA HUD need help how to make a backup of the files from his deleted with (shift + delete) memory card

    Hello

    It seems that you want to restore the files removed from the memory card.

    I will definitely help you with this.

    I would say you can search the Internet for data recovery software by using your favorite search engine.

    Warning: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    It will be useful. If you have any other questions, feel free to let us know. We will be happy to help you.

    Thank you.

  • I'm on Acrobat 10 and I need help with the distribution of shape feature. Is there a way to change the registration e-mail download addressed to the? Currently all forms I create and then distribute may only be subjected to my email account... I appreciat

    I'm on Acrobat 10 for mac and I need help with the distribution of shape feature. Is there a way to change the registration e-mail download addressed to the? Currently all forms I create and then distribute may only be subjected to my email account... I appreciate any help!

    Do not use the feature distribute the form. Instead of this, just put up a button "submit" and configure it to send email using any email address you want. Just add a button and set the action of the mouse upward on "Submit a form" and use a type mailto URL and specify that you want to send the full PDF. Then activate the reader of the document: where "Advanced/extended features in Adobe Reader" is located in Acrobat XI?

    If you really want to use distribute the form for some reason, change the e-mail address in your preferences: Edit > Preferences > identity > Email address

Maybe you are looking for

  • I want icon to stay there until I have openedd messages.

    When reinstalled Thunderbird hard drive replaced. Now the tray re icon new messages only very briefly, there rather than to what messages have been opened - which is what I'm used to I want to come back. Why this feature has disappeared? I had it bef

  • HP635: How to unlock Bios password with system hp635 code 28601104

    How to unlock hp635 Bios password with system code 28601104

  • recovery bios Compaq mini 110 c

    My compaq mini has a bios error problem. When turn on, he will not opt for a 'change boot device order' or 'bios Setup options', it jumps toENTER THE CURRENT PASSWORD: The error message is > password check faild fatal error... System stopped. CNU937D

  • Tags Id3v note to Clip + / Foobar2000

    I tried to synchronize the sides between my Clip + and PC software. However, I lack a bit of knowledge on the subject and am at loss when understand exactly what had a mp3 player synchronization involved, and exactly what the code is needed, I would

  • How to add memory to the HP Pavilion 15-p020nd

    Hello world Plz help me my Pavilion 15-p020nd for adding additional memory opening, I can't find any info on this subject. Kind regards Patrick