I need help to write script

I was doing a form fillable Friday and I had someone to help him, but it does not quite work. I need a field to be is the difference between two fields, OR, if this difference is 0 or a negative number, it must be '0 '. The code we have written has worked to do simple subtraction, but he was always playing the negative number, AND more important still, it wouldn't "Refresh" I've changed numbers (I had 36-30, so it was show 6, but even when I started to clear the fields, he would remain at 6)

Here is my domain names and needs:

If exchangetotal-returntotal < = 0, then the value I show is 0 in the "sub-total" field (IE, you do not get a credit or refund if the value of the goods you are returning is greater than what you are in Exchange for)

If exchangetotal-returntotal > 0, then the value is what is this difference. (IE, you will pay the difference if what you are sharing costs more expensive than what you have returned)

(I had planned to paste the code that we had, but my stupid work computer won't let me paste half the time)

In addition, this will of 'Custom calculation Script,' correct?


Thanks in advance!

~ Heather

You can use this script as "Subtotal" custom calculation script It will update automatically whenever you change a value of a field in your file (However, he won't like you, change only when you leave, because that's when the value actually takes effect):

var v1 = +this.getField("exchangetotal").value;
var v2 = +this.getField("returntotal").value;
if (v1<=v2) event.value = 0;
else event.value = (v1-v2);

Tags: Acrobat

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

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

  • 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 custom calculation Script

    I need to make a script are a column of fields based on or no information found in another column of fields is the same or specific text. Please find below the screenshot of what I would like that to be done.

    I would like a sum of all the amounts that had Code A...

    You can use this script as of 'SumOfA ': custom calculation script

    var total = 0;
    for (var i=0; i<=2; i++) {
        if (this.getField("p1TC."+i).value=="Code A")
            total+=Number(this.getField("p1RecIn."+i).value);
    }
    event.value = total;
    

    You can adjust easily to the other field as well.

  • 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);
    
    }
    
  • Need help to write a calculation Script using a checkbox

    Hello

    I am new to Adobe X Standard and Javascript.  I have all the other parts of my fillable on-screen modify the purchase order completed with the exception of the tax calculation.  I have the following fields:

    Text field = subtotal

    Text field = TAX

    CheckBox = free

    I would like that the calculation in the field of TAXATION, as follows:

    If the checkbox = false then subtotal *. 05, other = 0 subtotal.

    It really does seem that the complex but learn javascript on the fly is apparently above my skill level.  I would greatly appreciate someone help get this initial calculation work.  I really appreciate your time.  Thank you.

    Your description is a bit confusing for me. You want to calculate the value in the TAX field? In the last piece of pseudocode, you seem to be affecting subtotal 0. You want the SUBTOTAL times 0.05 value if it is so exempt exempt no tax and 0? If so, the script of custom computation of the TAX field can be:

    GetField("Exempt").value = Event.Value = "Off"? + getField("SUBTOTAL").value * 0.05: 0;

    This is equivalent to:

    If (getField("Exempt").value = 'Off') {}

    = Event.Value + getField("SUBTOTAL").value * 0.05;

    } else {}

    Event.Value = 0;

    }

  • Need help please this script... LucD? :-)

    Everything works as expected, but I have a problem with the two parts of the script. They are the bits where he itterates the NETWORK card and hard drives (pink and blue sections below).

    Problem with the NIC (Pink) loop - it only shows nic 0, and if there are multiple network cards - they are not out in the CSV file. Also returns only 0 NETWORK adapter MAC address and not the other nic MAC addresses...

    Problem with loop (blue) disc - it returns only the first TWO discs even if some of my VM 4 or even 5 discs...

    No idea why this is happening. This script is not my work, but I found it very useful for what I need...

    Script:

    Claire

    $VirtualCenter = Read-Host "Enter the Virtual Center server name".

    $FileLocation = Read-Host "Please Enter full Path and file name to save the output.  Must end in .csv or .txt.

    $Cred = get-Credential

    SE connect-VIServer $VirtualCenter - Credential $Cred

    $stats = @)

    #Uncomment the two lines if you want to inventory just a cluster instead of all the VMS in vCenter

    #$VMCluster = Read-Host "Please enter the name of the Cluster.

    #$ServerList = get-VM-location $VMCluster

    #If the two given lines are deleted, then comment out the following line

    $ServerList = get - VM

    {Foreach ($Guests to $ServerList)

    $Guest = $Guests.Name.ToUpper)

    Write-Progress-activity "Create VMware Guest Inventory" - Status "Treatment VM guest $Guest" # display progress bar

    $VMGuest = get - VM $Guest | Get-View

    $VM = get - VM $Guest

    $ESXHost is (get - VM $Guest). Host.Name.ToUpper)

    $VMHost = get-vmhost $ESXHost | Get-View

    $row = new-Object System.Object

    $row | Add-Member-Type NoteProperty-name 'Guest' - value $VMGuest.Name.ToUpper)

    $row | Add-Member-Type NoteProperty - name "Power status" - value $VM. Guest.State

    $row | Add-Member-Type NoteProperty - Name "Guest OS full name"-value $VM. Guest.OSFullName

    $row | Add-Member-Type NoteProperty-name "Comments RAM (MB)" - value $VM. MemoryMB

    $row | Add-Member-Type NoteProperty - Name 'Comments vCPU Count' - value $VM. NumCPU

    $row | Add-Member-Type NoteProperty - name "Guest VMTools status" - value $VMGuest.Guest.ToolsStatus

    $row | Add-Member-Type NoteProperty-name "Guest VMTools Version" - value $VMGuest.Guest.ToolsVersion

    $row | Add-Member-Type NoteProperty - name 'Guest status VMTools Version' - value $VMGuest.Guest.ToolsVersionStatus

    $row | Add-Member-Type NoteProperty - name "Comments VMTools status running" - value $VMGuest.Guest.ToolsRunningStatus


    $NICCount = 0

    ForEach ($vNic in $VM. Guest.Nics) {}


    $NIC_IP = "Guest IP Address for the NETWORK adapter" + $NICCount + "."

    $NIC_MAC = "MAC address of Guest for the NETWORK adapter" + $NICCount + "."

    $NIC_vSwitch = "Guest vSwitch network for the NETWORK adapter" + $NICCount + "."

    $row | Add-Member-Type NoteProperty - name $NIC_IP-$VMGuest.Guest.IpAddress value

    $row | Add-Member-Type NoteProperty - name $NIC_MAC-$vNic.MacAddress value

    $row | Add-Member-Type NoteProperty - name $NIC_vSwitch-$vNic.NetworkName value

    $NICCount ++

    }

    $DiskCount = 0

    $DT = @)

    ForEach ($vDisk in $VM. Guest.Disks) {}

    $DriveLetter = 'Comments Drive' + $DiskCount + ' ".

    $DriveSize = 'Comments Drive' + $DiskCount + 'size '.

    $DriveFree = 'Comments Drive' + $DiskCount + 'free space '.

    $vDiskCap = [math]: Round (($vDisk.Capacity)/1 GB)

    $vDiskFree = [math]: Round (($vDisk.FreeSpace)/1 GB)

    $row | Add-Member-Type NoteProperty - name $DriveLetter-$vDisk.Path value

    $row | Add-Member-Type NoteProperty-name $DriveSize - value $vDiskCap

    $row | Add-Member-Type NoteProperty-name $DriveFree - value $vDiskFree

    $DiskCount ++

    $DriveTotals = "" + $row. $DriveLetter + "" + $row. $DriveSize + ';

    $DT += $DriveTotals

    }


    $row | Add-Member-Type NoteProperty - Name 'Host name' - value $VMHost.Summary.Config.Name.ToUpper)

    $row | Add-Member-Type NoteProperty - name 'number of Sessions on the host' - value $VMHost.vm.Count

    $row | Add-Member-Type NoteProperty - Name "Is a member of the host Cluster" - value (Get-Cluster - VMHost $ESXHost). Name.ToUpper)

    $row | Add-Member-Type NoteProperty - name "Hosting provider" - value $VMHost.Hardware.SystemInfo.Vendor

    $row | Add-Member-Type NoteProperty - name 'Model home' - value $VMHost.Hardware.SystemInfo.Model

    $HostRam = [math]::Round(($VMHost.Summary.Hardware.MemorySize)/1Go)

    $row | Add-Member-Type NoteProperty - name 'RAM to host' - value $HostRam

    $row | Add-Member-Type NoteProperty - name "CPU model of home" - value $VMHost.Summary.Hardware.CpuModel

    $row | Add-Member-Type NoteProperty - name 'number of CPU host' - value $VMHost.Summary.Hardware.NumCpuThreads

    $row | Add-Member-Type NoteProperty - name 'The host CPU speed' - value $VMHost.Summary.Hardware.CpuMhz

    $row | Add-Member-Type NoteProperty - Name 'Name of the product to home' - value $VMHost.Summary.Config.Product.Name

    $row | Add-Member-Type NoteProperty - name 'Version of the product to home' - value $VMHost.Summary.Config.Product.Version

    $row | Add-Member-Type NoteProperty - name of the Generation of product to home' - value $VMHost.Summary.Config.Product.Build

    $row | Add-Member-Type NoteProperty - name of the "Service Console to host" - value $VMHost.Config.Network.ConsolevNic [0]. Spec.IP.IPAddress

    $row | Add-Member-Type NoteProperty - name "the subnet mask of Console Hosting Service" - value $VMHost.Config.Network.ConsolevNic [0]. Spec.IP.SubnetMask

    $row | Add-Member-Type NoteProperty - name of the "Service Console 1 to host" - value $VMHost.Config.Network.ConsolevNic [1]. Spec.IP.IPAddress

    $row | Add-Member-Type NoteProperty - name "the subnet mask of Console 1 Hosting Service" - value $VMHost.Config.Network.ConsolevNic [1]. Spec.IP.SubnetMask

    $row | Add-Member-Type NoteProperty - Name "vMotion Host IP Address" - value $VMHost.Config.vMotion.IPConfig.IpAddress

    $row | Add-Member-Type NoteProperty - Name "VMotion the subnet mask of the host" - value $VMHost.Config.vMotion.IPConfig.SubnetMask


    $stats += $row



    }

    $stats | Export-Csv-Force. \$FileLocation - NoTypeInformation

    Invoke-Item. \$FileLocation

    Thanks for your help

    PS. I'm a complete NOOB with Powercli, so try to find my way around it yet.

    PPS - if someone has a better VM inventory script - please be so kind as to pointing me to it...

    Thought as well, but I'm afraid he wil cover the possibilities.

    Assume the following:

    VM1, 3 cards, 2 hard drives

    VM2, 2 cards, 5 hard drives

    The order will be VM1, VM2 with the effect that you get 2 hard drives for VM2.

    The alternative I came with us to make Dummy entries and always use the maximum columns for network cards and hard drives.

    If you want to get

    NIC1 NIC2, NIC3 HD1 HD2 HD3 HD4 HD5

    VM1 x x x x x na na na

    VM2 x x na x x x x x

    See if it works for you.

  • 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

  • Need help to write a program for the acquisition of signals.

    Hello

    I need to write a program that will do the following:

    1 acquire two signals simulated,

    2. make 10 averages the signal,

    3. filter the signal,

    4. display the signal in its raw form and the power spectrum (fft),

    5. save the data using writing to the file vi

    I tried it for awhile, but there's always something does not... None of the experts LabVIEW here can help me?

    Thank you 1 million.

    -Deet

    No one here is going to do your homework for you. Please join what you have written so far and explain the specific problem that you are experiencing.

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

Maybe you are looking for

  • keyboard and multi langgages

    I work with a QWERTY keyboard. Because I often write in different languages, I would like AutoCorrect in the language I'm writing in. I know that on an iPhone and an iPad that's easy to do. I know that I can add different keyboards in iMac as well, b

  • Can I switch to 16 GB of RAM? and what RAM should I expect?

    I have a Lenovo IdeaPad Z400 cell phone has 2 RAM slots and I have 4 GB of RAM in each of them (ELPIDA J2108BDBG / product ID RMT3160ED58E9W1600) for a total of 8 GB. I wanted to upgrade to 16 GB. Take the laptop by inserting the 8 pieces of GB of RA

  • L293 in Multisim

    Hello I'm new in the world of Multisim. Just bought the product and hoped that it would allow to draw me circuit diagrams for the robot I design. Basis components L293D, LM324 and 74HC14. I intend to adapt the circuit diagrams of: http://www.syscompd

  • Add a network printer by using different credentials in Windows Vista Home Premium

    Hello I am trying to add a shared network printer (from server) of a computer running Windows Vista Edition Home Premium. The user must authenticate by using different credentials, but I can't find a way to force Vista to connect with different crede

  • How to stop blackBerry smartphones

    the implementation of messages from bb?  I'm 60 + every day - the subject is RIM_bca28a80-e9c0 - 11 d 1-87fe-00600811c6a2 It's those who say don't move, don't delete - I keep hope among those can solve my problems of e-mail before going change the st