Need help with a script of Fade Transitions

I'm new to scripting so apologies if I've made a few obvious mistakes.

In addition, do not know if there is already a feature in AE I don't know which will achieve

what I'm trying to do, but I want to learn AdobeExtendScript and thought it was a great app for a script.

I am trying to write a script allowing to adjusts video layers and opacity of the image key fades from 100% to 0% on a

length of the frameworks determined by the user. Nothing too crazy. I've tested this script with imported parts of first and

It works, kind of, but only when the first layer in the model is part of the selected layers.

Here's the script:

//

fadeTransitions.jsx (03/12/12)

Copyright © 2012 Paul Kelly for Perioperative Interactive education. All rights reserved.

http:pkvisualization.com

// http://pie.med.utoronto.ca

//

This script will be set a series of layers so that the layer opacity fades

from 100% to 0% over a length of frames determined by the user.

//

var theComp = app.project.activeItem; the value of a variable equal to the active composition

If (theComp == null |) (theComp instanceof CompItem) == false) / / check if the item is selected and make sure it is a CompItem

{

Alert ("you must have at least two selected layers");

} else {}

var numberOfLayers = theComp.selectedLayers.length; the value of a variable equal to the total number of selected layers

If (numberOfLayers == null: numberOfLayers < 2) / / make sure there are at least two selected layers

{

Alert ("you must have at least two selected layers");

} else {}

var startLayer = prompt ("first layer to be affected:", "layer #");

you want to remove this prompt and set a variable for the above selected layer.

var startLayer = theComp.selectedLayers [0]; does not work. I want the lowest layer indexed multiple selected layers

fadeTransitions();

} //end second otherwise: numberOfLayers test

} //end first thing: theComp test

function fadeTransitions()

{

app.beginUndoGroup ("FadeTransitions");

var overlap = parseInt (command prompt ("specifies the length of the fade-off (frames)", "0" "));

overlap overlap = * theComp.frameDuration;

for (var i = 1; i < = numberOfLayers; i ++)

{

var layerIndex = (startLayer - 1) + i; create the layer index, subtract 1 for compensation of the correct layer

If (layerIndex > numberOfLayers) {//end before layerIndex becomes more than numberOfLayers

Alert ("Transitions Fade script');

break;

} else {}

var topLayerEnd = .outPoint theComp.layer (layerIndex);

If ((layerIndex+1) > numberOfLayers) {//end before (layerIndex + 1) becomes more than numberOfLayers

Alert ("Transitions Fade script');

break;

} else {}

var btmLayerStart = theComp.layer(layerIndex+1).inPoint;

var btmLayerEnd = theComp.layer(layerIndex+1).outPoint;

term var = btmLayerEnd - btmLayerStart;

theComp.layer(layerIndex+1).inPoint = (topLayerEnd - overlap);

theComp.layer(layerIndex+1).outPoint = (topLayerEnd + duration);

theComp.layer (layerIndex).opacity.setValueAtTime ((theComp.layer (layerIndex) .outPoint - overlap), 100);

theComp.layer (layerIndex).opacity.setValueAtTime (theComp.layer (layerIndex) .outPoint, 0);

} //end 2nd else

} //end 1 else

} //end for loop

app.endUndoGroup ();

} //end fadeTransitions function

#1 problem: I want to eliminate the prompt asking the startLayer, instead, I want the first layer to be the highest of

a selection of layers, so that at any time, you can select a series of layers and run the script only affect these layers.

I tried to do this by setting a variable app.project.activeItem.selectedLayers [0]; but it did not work. This function would be really

required during the later stages of compositing, when there are a lot of layers of subtitles, audio, 3D rendered images, etc. above

layers of film in the model.

#2 problem: unless the selected layers are pre-established way cascading, I get some really weird adjustments to the in-

and outPoints. Not sure what is the cause. This isn't a priority, because most of the time I want to use this script layers

will be already prepared properly (I import a Premiere Pro sequence), but still, I would like to know how I could solve this problem

and to better understand how works ExtendScript.

Problem #3: Right now, the way that these guys down inPoints are adjusted, is the same as if I flew over the inPoint layer with the mouse and

got horizontally in line with the arrows of face to face and click-slipped the inPoint backward, but what I prefer is the

equivalent of if I fly in the middle of the layer from the Selection tool and click-and - drag the entire layer L or R, so that it is inPoint

is always in the same place in the sequence. As problem #2, it is not a great problem, I just want to better understand what is happening

in the script. I tried to use startTime instead of inPoint in the script, but then it just stopped working completely.

Any help/ideas would be greatly appreciated, and everyone feel free to use what I have so far if you wish.

This give a try. I have not tested much, but I think it's pretty close to what you are after. It is not as limited to a selection of contiguous layers.

//

fadeTransitions.jsx (03/12/12)

Copyright © 2012 Paul Kelly for Perioperative Interactive education. All rights reserved.

http:pkvisualization.com

http://pie.med.utoronto.ca

//

This script will be set a series of layers so that the layer opacity fades

from 100% to 0% over a length of frames determined by the user.

//

var indexArray = new Array();

var theComp = app.project.activeItem; the value of a variable equal to the active composition

If (theComp == null |) (theComp instanceof CompItem) == false) / / check if the item is selected and make sure it is a CompItem

{

Alert ("you must have at least two selected layers");

} else {}

var numberOfLayers = theComp.selectedLayers.length; the value of a variable equal to the total number of selected layers

If (numberOfLayers == null: numberOfLayers)< 2)="" make="" sure="" there="" are="" at="" least="" two="" layers="">

{

Alert ("you must have at least two selected layers");

} else {}

"selectedLayers" is based on the order of selection, need a different approach to ensure that we are working from top down

make an array of the indices of layer

for (var x = 0; x)< numberoflayers;="" x++)="">

indexArray.push (theComp.selectedLayers [x] .index);

}

sort the indexArray

indexArray.sort ();

var startLayer = indexArray [0];

fadeTransitions();

} //end second otherwise: numberOfLayers test

} //end first thing: theComp test

function fadeTransitions()

{

var overlap = parseInt (command prompt ("specifies the length of the fade-off (frames)", "0" "));

If (overlap == null) return; If the user has canceled guest

overlap = parseInt (overLap);

If (isNaN (overLap)) return;          If the user does not enter the number

app.beginUndoGroup ("FadeTransitions");

overlap overlap = * theComp.frameDuration;

var layerIndex, topLayerEnd, btmLayerStart, btmLayerEnd, duration, startTimeOffset;

for (var i = 0; i)

{

layerIndex = indexArray [i];

topLayerEnd = .outPoint theComp.layer (layerIndex);

If (i + 1< numberoflayers)="" {="" end="" before="" (layerindex+1)="" becomes="" more="" than="">

btmLayerStart = theComp.layer(indexArray[i+1]).inPoint;

btmLayerEnd = theComp.layer(indexArray[i+1]).outPoint;

duration = btmLayerEnd - btmLayerStart;

need to calculate the offset if inPoint is not at the beginning of the layer

startTimeOffset = btmLayerStart - theComp.layer(indexArray[i+1]).startTime;

move the layer by changing startTime rather than inPoint

theComp.layer(indexArray[i+1]).startTime = (topLayerEnd-overlap - startTimeOffset);

theComp.layer(indexArray[i+1]).outPoint = (topLayerEnd + duration);

theComp.layer (layerIndex).opacity.setValueAtTime ((theComp.layer (layerIndex) .outPoint - overlap), 100);

theComp.layer (layerIndex).opacity.setValueAtTime (theComp.layer (layerIndex) .outPoint, 0);

}

} //end for loop

Alert ("Transitions Fade script');

app.endUndoGroup ();

} //end fadeTransitions function

Tags: After Effects

Similar Questions

  • Need help with a script (o - o8) *, see the Virgin if there is no

    Hi all what I need help with a script I can't find an example.

    I'm trying to subtract 2 numbers and then multiply this product. (o o8) * one but I just want to do the calculations if all fields have the numbers IE field o, o8 of field and field one.

    Thank you in advance. I was stuck on this days searching the Internet.

    Assuming you want to affect the outcome of this calculation in another text field, use this code as a custom field calculation script:

    var o = this.getField("o").valueAsString;
    var o8 = this.getField("o8").valueAsString;
    var a = this.getField("a").valueAsString;
    if (o!="" && o8!="" && a!="") event.value = (Number(o)-Number(o8))*Number(a);
    else event.value = "";
    
  • Need help with custom script to rename the layers

    Hello world.

    I need help to write a custom script (because I suck at it) that will allow me to go through all the layers and sous-calques for a specific name ('X') and give it a new specific name ('Y').

    I have had success using the script below, but it does not work on any text layers names where the text layer was previously particularly well-known in 'X' and now changed needs.

    Any help is greatly appreciated.

    * Note: this script was originally used to find any layer with 'Copy' in its name and remove with anything after (to correct the problem of duplication of layers by adding this text).

    This is why the function is named removeCopy. It works for renaming layers also - just not a layer of text unfortunately.

    #target illustrator

    function removeCopy() {}
    If (app.documents.length == 0) return;
    var app.activeDocument = docRef;
    recurseLayers (docRef.layers);
    }
    removeCopy();
    function recurseLayers (objArray) {}
    for (var i = 0; i < objArray.length; i ++) {}
    ObjArr [i] .name = ObjArr [i].name.replace (/ \s*current name\s*\d*/, 'new name');
    If (objArray [i] .layers) recurseLayers (. layers.length > 0 ObjArr [i]);
    }
    }

    I finally found something after searching forums for a week. My confusion was related to the way Illustrator treats real layers against text/path/object "layers." Instead of layers, I had to use the pageItems in the script. The code below works. Thanks to Gustavo for his answer in another thread and Carlos I thank you for this looking too good! You're great to be ready to help models do more advanced things with Illustrator.

    var doc = app.activeDocument;
    var items = doc.pageItems;
    for (var g = 0; g)
        elements [g] .name = elements [g].name.replace ('Century Schoolbook text line', ' MonogramText: Century Schoolbook ");
    };
    App.Redraw ();
  • Need help with a script customized for processing in Photoshop CS4 of images in batches. Really grateful for the help thereby.

    Hi people.

    So I have a boatload of pictures that I have to deal with as I'm moving off Ebay and open my own online store and the images that I have on Ebay, although excellent quality are not square, and unfortunately, the model that I use in Wordpress requires square photos.

    Basically, what I need is a script that I can use in batch mode, which will focus on the size of the image and change the canvas size to be square corresponding to the current long image side. Resize the image to 1600 square pixels and finally save for web in JPEG quality 60.

    Normally I would muddle my way through this trying to teach myself but I already do so much with this new project that I can't afford to pay developers for help that I would really appreciate if someone could help me with this script. I use Photoshop CS4 if it made a difference.

    Thanks much for any help you can offer.

    See you soon,.

    J

    A simple gesture can do that. What you need to do is that the action of lot.   With the help of Photoshop Image Processor script.  The Action is a two-step

    N ° 1). File menu > automate > fit Image.  In the dialog box Image Fit you assign Width and Height 1600 pixels.

    Step 2.) Menu Image > canvas size.  In the canvas size dialog box, you assign Width and Height 1600 Pixels.

    Record the action in some action with a name like 1600PxSquare

    Then use the file menu to Photoshop > Scripts > image processor. In the dialog to the Image Processor script. Select your image source folder. Set where you want your jpeg images. Set it to save jpeg files quality 6.  Set it to include your 1600PxSquare action.

    Step adjustment image resize your image to fit in a 1600 x 1600 pixels are while keeping image proportions of images. Portrait image will be high 1600px and landscape image will be 1600px wide.  The step size canvas will add the canvas to make the place of the image.  Portraits will have a border on the left and right images of landscape will be confined to the op and downs.

  • Need help with transformation Script

    Well I'm back for the 2nd time today. I would like to thank all those who helped me with my last issue. But now I have another question that I'm developing. Craig & Dan here me helped with 2 separate sending email responders based on questions in the form.

    You can view the form on this link:
    http://mswebsol.com/gaslockguarantee/creditapplication.cfm

    The problem I have right now, is that I don't get the results that I'm looking. Basically lets say you choose Yes to all 4 questions but on the 5th issue, you click on no. Well as it is now the script sends the answer by e-mail indicating your accepted. But what I'm trying to make, is that if you choose not to one of the questions you will automatically get an e-mail response that says you are not admitted.

    If I choose not to question, I'll get the answer correct email which is "your not accepted" to make it work for the first question. But if you choose Yes to the first question and no to the 2nd or any other question you will get the wrong answer that says "you are accepted."

    Here is the code

    < Cfif StructKeyExists(form,"Q1") >
    < cfif form. Q1 is 'Yes' >
    < intrusion via cfmail > accepting... < / intrusion via cfmail >
    < cfelse >
    < intrusion via cfmail > not accepting... < / intrusion via cfmail >
    < / cfif >

    < cfelseif StructKeyExists (form, "Q2") >
    < cfif form. Q2 eq 'Yes' >
    < intrusion via cfmail > accepting... < / intrusion via cfmail >
    < cfelse >
    < intrusion via cfmail > not accepting... < / intrusion via cfmail >
    < / cfif >

    < cfelseif StructKeyExists (form, "Q3") >
    < cfif form. Q3 eq 'Yes' >
    < intrusion via cfmail > accepting... < / intrusion via cfmail >
    < cfelse >
    < intrusion via cfmail > not accepting... < / intrusion via cfmail >
    < / cfif >

    < cfelseif StructKeyExists (form, "Q4") >
    < cfif form. Q4 eq 'Yes' >
    < intrusion via cfmail > accepting... < / intrusion via cfmail >
    < cfelse >
    < intrusion via cfmail > not accepting... < / intrusion via cfmail >
    < / cfif >

    < cfelseif StructKeyExists (form, "Q5") >
    < cfif form. Q5 eq 'Yes' >
    < intrusion via cfmail > accepting... < / intrusion via cfmail >
    < cfelse >
    < intrusion via cfmail > not accepting... < / intrusion via cfmail >
    < / cfif >
    < / cfif >

    Any help would be greatly appreciated!

    Thanks to you all

    Derek Bess
    @ Coldfusion newbie

    If I understand you well, all your if/else logic boils down to a simple:
    (1) one of the answers is "No" - send 'rejected' by email
    (2) all the answers are "Yes" - email "accepted."

    I suggest you cfparam all default = 'no' on your action and answers
    the page, so that you don't have to keep control of structkeyexists:


    ...

    After that, all you need is:


    .. .send 'rejected' code email here...

    .. .send 'admitted' code email here...

    HTH

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • Need help with Java Script to perform a calculation in the form of Adobe Acrobat Pro 9

    I have a form (test) I created in Adobe Acrobat 9 Pro.

    I need help to create a custom JavaScript, so I can get the desired response.

    1) there are several questions in each group requiring a numeric response between 0-4

    2) there is a total set up field to calculate the sum of the responses of all of the above questions

    (3) the final "score" takes the answer in step 2 above and divide by the total possible response

    Any help to what Java Script I need to fill it would be greatly appreciated!

    I have attached a spreadsheet "" which shows more in detail as are the result of what I used in Excel to get the desired end formulas.

    Thanks in advance.

    Have you tried the "field is the average of:"?

  • Need help with windows scripting/media literacy

    It's kind of a strange question. I have a program at the same time a different video each month. every time that it runs, it checks to see which month it is and play the appropriate video. I have downloaded with the .mp4 extension videos and the program is just a batch file. I need the program to run whenever I start my computer, but after I connect. There should be a little late after that I connect to avoid crashing everything (my computer is a bit slow). I'm ready to use other programs. Help, please. BTW, I'm not quite sure which forum to post this in, let know me if I should change.

    Try this:

    1. Press +R to open the run.  Type : startup of the shell and click OK.
    2. Put here your batch file (or a shortcut)

    Now, when you connect, the batch file will run once the computer is recording in.

  • Girls need help with a script to repeat the link to another folder in indesign

    I REALLY hope you smart people can help me.

    We had servers which means that all of our Indesign documents now have a broken link. To manually "re-edit the link to the file" causes Indesign down :-(. And it takes forever I am hoping to find a script that can connect all the links in the doc to a new file structure.

    The name of the link (name of file) and the file structure remains the same; Just point to another server. The structure contains subfolders so the best way would be that the script can see subfolders as well, but otherwise I would gladly use a script that points of 6 subfolders at a time.

    Problem - I KNOW NOT ALL SCRIPTS and I'm a graphic designer so I can't create scripts :-(. I have already had success Googling a script to unlink everything in the document, but I don't know how to run the script. DO NOT to create them.

    ANY help in this forum? I have 6 designers waiting for me to fix this.

    Is there a script where I could just change the path and then he could repeat?

    We have iMac OSX Yosemite 10.10.4

    PLEASE HELP... :-)

    / Dina

    Try this... it is created by Vamitul

    main() {} function

    var doc = app.activeDocument;

    myLinks var = doc.links.everyItem () .getElements ();

    var linkObj = {};

    Create the initial object

    / * {linkObject

    [path] {missingNr,

    arrayOfMissingLinks}

    } */

    for (var i = 0; i)< mylinks.length;="" i++)="">

    If (myLinks [i] .status == LinkStatus.LINK_MISSING) {}

    var myPath = File(myLinks[i].filePath).path.toString ();

    If (linkObj [myPath] == undefined) {}

    linkObj [myPath] = {}

    missingNr: 1.

    missingLinks: [myLinks [i]],.

    newPath: "

    }

    } else {}

    linkObj [myPath] .missingNr ++;

    linkObj [myPath].missingLinks.push (myLinks [i] .getElements () [0]);

    }

    }

    }

    $.writeln (linkObj.toSource ());

    var myDialog = new window ("dialog", "link Chaser:', undefined");

    Panel1 = myDialog.add var ('panel', undefined, "double-click to select the new path '");

    Panel1. Align = ["fill",""];

    myList var = panel1.add ("listBox", undefined, "", {})

    columnWidths: [160, 160, 130],

    numberOfColumns: 3,.

    showHeaders: true,

    columnTitles: ['old road', 'New Path', 'Nr. missing links']

    });

    myList.size = [450, 200];

    myList.align = ["fill",""];

    for {(var missingPath in linkObj)

    with (myList.add ("item", missingPath)) {}

    Subitems [0] .text is linkObj [missingPath] .newPath;.

    Paragraphs [1] .text is linkObj [missingPath] .missingNr;.

    }

    }

    myList.onDoubleClick = function() {}

    var myNewPath = (new folder (app.activeDocument.filePath) .selectDlg ("Select New Folder") |. toString() ' ");

    myList.selection.subItems [0] .text = myNewPath;

    linkObj [myList.selection.text] .newPath = myNewPath;

    }

    myDialog.add ('button', {undefined, "Ok",

    name: 'ok '.

    });

    myDialog.add ("button", undefined, "Cancel", {})

    name: "Cancel".

    });

    If (myDialog.show () == 1) {}

    for (var i in linkObj) {}

    If (linkObj [i] .newPath! = ") {}

    var fixedNr = 0;

    Var links = linkObj [i] .missingLinks

    for (var j = 0; j)< links.length;="" j++)="">

    var queue = newFile (linkObj [i] .newPath + "/" + links [j] .name);

    If {(newFile.exists)

    fixedNr ++;

    Links [j] .relink (NewFile);

    }

    }

    Alert ("in the folder: \n" + linkObj [i] .newPath + '\n' +)

    'Fixed' fixedNr ' links of ' + linkObj [i] .missingNr + '\n ' +.

    "Please check");

    }

    }

    };

    }

    app.doScript ('main()', undefined, undefined, UndoModes.entireScript, "Chaser link");

  • need help with a script of PowerCLI report IOPS / s

    I found the following script that gives me the data I want, but not ultimately I need. At the moment he puts it in the PowerCLI window, but I need to get into a csv file so it can be easily sent to others for review.

    This is the script that I found:

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    Add-pssnapin VMware. VimAutomation . Core -ErrorAction SilentlyContinue

    $daysback = -30

    write-host ' What vCenter you want to connect to? -You may be prompted for a user name and password'

    write-host ""

    Se connect-VIServer -menu

    write-host ""

    $vm_data = reading-host "Enter the number of a-Org"

    write-host ""

    write-host "ARE gathering Ops / s Stats"

    write-host ""

    $vms = Get-Folder | where {$_. Name -like "*$vm_data*" } | get-vm | where {$_. PowerState -eq "PoweredOn" }

    write-host ( "{0,-70}`t{1,8}`t{2,8}`t{3,8}`t{4,8}" -f "VM", "W IOPS avg", "R IOPS avg", "W IOPS max", "R IOPS max" ) `

    ; $vms | sort | % {

    $wval = ()()()Get-Stat $_ -stat « datastore.numberWriteAveraged.average » -Start ()Get-Date). AddDays ($daysback) -Finish (Get-Date) ) | select -expandproperty Value) | measure -average -max);

    $rval = (((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -Start (Get-Date). AddDays ($daysback) -Finish (Get-Date) ) | select -expandproperty Value) | measure -average -max);

    write-host ( "{0,-70}`t{1,8:N2}`t{2,8:N2}`t{3,8:N2}`t{4,8:N2}" -f $_. Name , $wval. average , $rval. average , $wval. maximum , $rval. maximum )

    }

    write-host ""

    write-host "You can copy the output by selecting the text and copy it to NotePad ++ or similar: .

    write-host " " "

    " read-host" Hit Enter to Output.

    In one, I run, I changed the "Connect-VIServer-menu" to simply plug the vCenter Server I use. I also changed line 16 to 'Get-ResourcePool' since there's not enough pools to make this work. Using the PowerCLI utility, I don't have the option that indicates on line 25. I used the export feature to create csv files in other scripts, but I can't make it work in this case. I know it's probably something simple that I'm just missing.

    I like the length of time that this script uses the information. If anything, I don't want to go back to the suite to get a better idea of what the actual maximum number what is / was. It is also necessary to have the columns for information (as he shows). If we are to refine for which metric is present, I would be ok with just having the IOPS numbers / s max in the table.

    Any guru PowerCLI have an idea?

    Try like this

    Add-pssnapin VMware.VimAutomation.Core - ErrorAction SilentlyContinue

    $daysback = - 30

    write-host "what vCenter you want to connect to? -You may be prompted for a user name and password"

    write-host "

    SE connect-VIServer-menu

    write-host "

    $vm_data = read-host "enter the number of a - Org"

    write-host "

    write-host "gathering IOPS / s Stats.

    write-host "

    $vms = get-file | where {$_.} {Name: like "* $vm_data *"} | Get - VM | where {$_.} PowerState - eq "Receptor"}

    $report = $vms | kind | % {

    $wval = (((get-Stat_$_-stat_"datastore.numberWriteAveraged.average"-Start_(Get-Date).adddays ($daysback) - Finish (Get-Date)) |))

    Select - expandproperty value) | measure - average - max);

    $rval = (((get-Stat_$_-stat_"datastore.numberReadAveraged.average"-Start_(Get-Date).adddays ($daysback) - Finish (Get-Date)) |))

    Select - expandproperty value) | measure - average - max);

    $_ | Select Name,

    @{N = "IOPS / W avg s";} E = {$wval. Average}},

    @{N = "Avg R Ops ARE / s";} E = {$rval. Average}},

    @{N = "W IOPS / s max";} {E = {$wval.maximum}}.

    @{N = "IOPS R / s max";} {E = {$rval.maximum}}

    }

    $report | Export Csv report.csv - NoTypeInformation - UseCulture

  • Need help with a script

    Hey people. I've been using the script below and it works very well when you do 1 VM. When I try and make several virtual machines, he made the copy of model first for all virtual machines and eventually making customization for only the last in the list. What I need is to know how to fix this, so that the script generates 1 VM at once, including the customization and power on, and then continues in #2, 3, etc.

    Thanks to Mark and Lucd for the original script

    ##########################################################

    #

    # Mark Jones 23/02/2012

    # Version 3

    #

    ##########################################################

    Game-PowerCLIConfiguration - ignore InvalidCertificateAction - confirm: $false

    $vcenter = Read-Host "enter the name of Vcenter.

    $csvimport = Read-Host "Enter CSV filename (with extension fullname)"

    $username = read-host "enter your username admin area for customization.

    $pass = Read-Host - AsSecureString "Enter your password"

    $adminpass = Read-Host - AsSecureString "Local admin password"

    #convert chain

    $pass = [System.Runtime.InteropServices.Marshal]: SecureStringToBSTR ($pass)

    $pass = [System.Runtime.InteropServices.Marshal]: name ($pass)

    $adminpass = [System.Runtime.InteropServices.Marshal]: SecureStringToBSTR ($adminpass)

    $adminpass = [System.Runtime.InteropServices.Marshal]: name ($adminpass)

    SE connect-VIServer $vcenter

    $vmlist = import-CSV $csvimport

    {foreach ($item in $vmlist)

    # I love draw my variables

    $basevm = $item.template

    $datastore = $item.datastore

    $vmhost = $item.vmhost

    $custspec = $item.custspec

    $vmname = $item.vmname

    $ipaddr = $item.ipaddress

    $subnet = $item.subnet

    $gateway = $item.gateway

    $pdns = $item.pdns

    $sdns = $item.sdns

    $vlan = $item.vlan

    $location = $item.location

    #Clone models

    $tasks += (new-VM-name $vmname - model $basevm - $location - $datastore - VMHost Datastore $vmhost - RunAsync location)

    }

    Write-Host "Waiting for Copies at the end.

    #Wait for all taksks in the list of tasks before proceeding

    Waiting-task-task $tasks

    {foreach ($item in $vmlist)

    $datastore = $item.datastore

    $custspec = $item.custspec

    $ipaddr = $item.ipaddress

    $subnet = $item.subnet

    $gateway = $item.gateway

    $pdns = $item.pdns

    $sdns = $item.sdns

    # $vlan = $item.vlan

    $hd = [int] $item.ddrive * 1024 * 1024

    $hd2 = [int] $item.edrive * 1024 * 1024

    $hd3 = [int] $item.fdrive * 1024 * 1024

    $vmname = $item.vmname

    $cpu = $item.cpu

    $mem = [int] $item.mem * 1024

    customization #set spec

    New-OSCustomizationSpec-spec $custspec - name $vmname - type persistent

    Game-OSCustomizationSpec-spec $vmname - $adminpass - $username - DomainPassword $pass DomainUsername AdminPassword - confirm: $false

    Get-OSCustomizationSpec $vmname | Get-OSCustomizationNicMapping | Game-OSCustomizationNicMapping - IpMode UseStaticIp - IpAddress SubnetMask - $subnet - $gateway - Dns $pdns passerelle_par_defaut, $sdns $ipaddr

    Network #Set label

    # Get - VM - name $vmname | Get-NetworkAdapter | Together-NetworkAdapter - NetworkName $vlan - confirm: $false | Out-Null

    #set vm

    Set-VM - $vmname OSCustomizationSpec - $vmname - $cpu NumCpu VM - MemoryMB $mem - confirm: $false

    #Create D windows player

    If {($hd)

    New-disk-hard - VM $vmname CapacityKB - $hd - ThinProvisioned: $true - confirm: $false

    }

    #Create E windows player

    If {($hd2)

    New-disk-hard - VM $vmname CapacityKB - $hd2 - confirm: $false

    }

    #Create F windows disk

    If {($hd3)

    New-disk-hard - VM $vmname CapacityKB - $hd3 - confirm: $false

    }

    #Remove Cust Spec

    Delete OSCustomizationSpec - CustomizationSpec $vmname - confirm: $false

    }

    {foreach ($item in $vmlist)

    $vmname = $item.vmname

    #Start VM

    Start-VM - $vmname VM - confirm: $false - RunAsync

    }

    Disconnect-VIServer $vcenter - confirm: $false

    Try to replace this

    $tasks += (new-VM-name $vmname - model $basevm - $location - $datastore - VMHost Datastore $vmhost - RunAsync location)

    with

    $tasks = @(nouvelle-VM-nom $vmname-modèle $basevm-emplacement $location Datastore-$datastore-VMHost $vmhost-RunAsync)

    The error came from the fact that there is now only 1 task generated by the New - VM and the variable $tasks we not defined as an array in the script.

    You can use the addition on a table, but not on a simple variable.

    With the @ (...) construction, we have the only object in an array with 1 element.

  • I need help with Java Script if/then statement

    I have absolutily no experience writing Java Script any help at all would be appreciated.

    I am working on a form in which I need a box for the person filling out the form click if they are a company be exempt from taxes. Well, obviously when they check the box I need field sales tax to change $ 0.00 total cost will only be calculated on the price of the items.

    Currently I use steps in the field of calculation for my Salestax.

    var k = this.getField ("SubTotal");

    K.value = Event.Value * 0.0825;

    Yet once, all possible assistance would be greatly appreciated.

    Tiffany

    Let's say the name of the box is "IsTaxExempt". Then you can use this code as the field of Salestax calcluation:

    If (this.getField("IsTaxExempt").value == "Off") {}

    var k = this.getField ("SubTotal");

    K.value = Event.Value * 0.0825;

    } else event.value = 0;

  • Need help with my script

    Hello! I am fairly new to dreamweaver, I tried to login.php and all that, I went to some tutorials and I got somethings to them. But now I am facing a problem that no tutorial I searched cannot fix, because I think it's a pretty simple problem and I hope you guys could help out me!

    Here is the script

    < html >

    < head >

    < style type = "text/css" >

    UL

    {

    text-align: center;

    list-style-type: none;

    margin: 0;

    padding: 0;

    overflow: hidden;

    }

    Li

    {

    float: left;

    }

    a: link, a: visited

    {

    Display: block;

    Width: 100px;

    make-weight: bold;

    color: #FFFFFF;

    background-color: #000000;

    text-align: center;

    padding: 4px;

    text-decoration: none;

    text-transform: uppercase;

    }

    a: hover, a: active

    {

    background-color: #cccccc;

    }

    {body

    left margin: 25%;

    margin-right: 0px;

    }

    body, td, th {}

    do-size: 80%;

    }

    < / style >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 ">"

    < body >

    < img src = "Ocean.jpg" width = "601" height = "132" align = "middle" alt = 'Océan' > "

    < ul >

    < li > < a href = "mainpage.php" > home < /a > < /li >

    < li > < a href = "#news" > News < /a > < /li >

    < li > < a href = "#contact" > Contact < /a > < /li >

    < li > < a href = "#about" > on < /a > < /li >

    < li > < a href = "#Forum" > Forum < /a > < /li >

    < li > < a href = "Logout.php" > (Logout) < /a > < /li >

    < /ul >

    < / body >

    < / html >

    So my problem is, when I test on my server "test", my background image seems to appear, she seems perfect to my 'Design' on Dreamweaver mode, so I'm confused.

    You upload your picture of Ocean.jpg to break?

    Really named Ocean.jpg image?  Some servers are case sensitive.  "Océan" is not the same thing as "ocean".

    Nancy O.

  • Need help with java script

    I have a small script that changes the color of a button image that I use for a popup topic. It does this, of course, by exchanging the two images.

    The script works very well in HR overview and also when the htm page is opened directly in a browser (IE or Chrome).

    However, when I open the topic in the compiled help, the second image does not display.

    Those who work in HR overview. Who isn't in the compiled help.

    Here is the code:

    < a href = "javascript:BSSCPopup('..)". /MenuLocations/3DFace_menu_location.htm'); »

    "ID ="a1"style =" "position: relative;" > < img onmouseover = "this.src = '... /ClickButton - O.png'.

    onmouseout = "" This.src = '... ClickButton.png' ""

    "SRC ="... / clickbutton.png ".

    ALT = "Click for locations of menu and toolbar and related topics."

    border = "0" / >

    Any ideas?

    ~ Margaret Becker

    HI Margaret

    You should probably add the second image to luggage to its intended location. Because JavaScript must manage by exchanging images, RoboHelp is probably not aware of the second image.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Need help with java script date

    Hi all

    Using Mac OS 10.6.8 and Adobe Acrobat 9.

    I am working on a form that has course date when you open the form.

    I have a field to enter an earlier date.

    If the effective date is = to or more than 3 years old (1095 days), then it will show a hidden field "sorry your registration has expired.

    If date enered is less than 3 years, then the field remains hidden.

    I have a field to display the result in days, I'm going to hide once the script works.

    Here is the shape right now.

    www.nixmailmac.com/register.PDF

    Any help would be appreciated.

    Ron has

    The code that I provided above is a compacted to if-then-else way. If you really want to, you can use this instead:

    If (event.value< 1095)="">

    getField("Enter_Field_Name_Here").display = display.hidden;

    } else {}

    getField("Enter_Field_Name_Here").display = display.visible;

    }

  • Need help with the Script to remove the option data download of a page

    Hi all

    I have a requirement where in I need to delete download option given specifically to a page for a particular set of reports. I wrote a java script...

    < script type = "text/javascript" >
    function RemoveOption()
    {
    TDS var = document.getElementsByTagName ('a');
    for (td var = 0; td < tds.length; td ++)
    {
    If (tds [td] .className! = "NQWMenuItem")
    {
    continue;
    }
    var tHTML is tds [td] .innerHTML;.
    tHTML = tHTML.replace ("download data","" ");
    TDS [td] .innerHTML = tHTML;
    }
    }
    Window.OnLoad = RemoveOption;
    < /script >

    that works very well up to a point every time IE it deletes a page load. but in case I have a view selector in a report or on a table whn I click the next Recordset it only gives me the desired result.

    Then...

    I was hoping that if someone has a better way to do it... If so can you please share it...


    Thanks in advance...

    Published by: Ashu M 25 May 2010 13:28

    Try to use the event window.onFocus instead.

    What about John
    http://obiee101.blogspot.com/

Maybe you are looking for

  • my iphone has activation lock

    Your Service and Support coverage iPhone 5 s Serial number: DN * NJJ Check another serial number Valid purchase date A valid purchase date allows Apple to quickly find your product and provides the help you need. Telephone technical support: Active Y

  • Is safe to use on Mac WebGuard

    Hello Is it safe to use WebGuard, which can be downloaded from ITuens on my Mac Mini.  I don't want to cause any me problems, your help will be very appreciated as always. Much thanks rachealfromva

  • Tecra S11 - fan high speed

    Hi guys,. I need help on a question that really puzzle me. After I tried to do a bios update to the last version (February, 2012), in windows 7, I got an error message stating that I didn't have permission to do the update. Since then, the fan starts

  • PC card - can I use it for?

    Excuse my ignorance, but I have a slot for pc card on the side of my laptop (equium L20). What kind of job could I use it for? Some of my games does not work, I put some sort of bulletin of upgrade?

  • Decision SSD clearly, but TRIM gray?

    Hello I just downloaded the new dashboard Sandisk SSD. It seems TRIM for my extreme II SSD optimization is gray, although the security status of the drive should be clear (or at least, I saw not a clue showing that it is defined otherwise). Is this a