PowerShell Scripting help to combine two scripts

I have a script that helps automate virtual server builds.  The script creates a specification document which is used to perform the actual builds.
# Spec-And-Build.ps1 - Loops through a directory and performs an
# end to end specification generation and build on each request in that directory
[CmdletBinding()]
Param(
    [Parameter(Mandatory=$true)]
    [string]$RequestDir,
    [Parameter(Mandatory=$true)]
    [string]$SpecDir,
    [Parameter(Mandatory=$false)]
    [pscredential]$Credential_CPR,
    [Parameter(Mandatory=$false)]
    [pscredential]$Credential_VDC,
    [Parameter(Mandatory=$false)]
    [pscredential]$Credential_Admin
if (!$Credential_CPR) {
    $Credential_CPR = Get-Credential -Message "CPR Domain Credentials."
    if (!$Credential_CPR.UserName.ToUpper().StartsWith("CPR\")) {
        $Credential_CPR = New-Object pscredential(
            ("CPR\" + $Credential_CPR.UserName), $Credential_CPR.Password)
if (!$Credential_VDC) {
    $Credential_VDC = Get-Credential -Message "VDC Domain Credentials."
    if (!$Credential_VDC.UserName.ToUpper().StartsWith("VDC\")) {
        $Credential_VDC = New-Object pscredential( `
            ("VDC\" + $Credential_VDC.UserName), $Credential_VDC.Password)
if (!$Credential_Admin) {
    $Credential_Admin = Get-Credential -UserName "Administrator or root" `
        -Message "Enter the Administrator or root password for the new VM. The user name here will be ignored"
.\Gen-VMSpec-Many.ps1 -RequestDir $RequestDir -SpecDir $SpecDir -Credential_VDC $Credential_VDC
$caption = "Continue Build"
$message = "Please validate the generated specification files in $SpecDir - Then click Continue to start build"
$opContinue = new-Object System.Management.Automation.Host.ChoiceDescription "&Continue","help"
$opAbort = new-Object System.Management.Automation.Host.ChoiceDescription "&Abort","help"
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($opContinue,$opAbort)
$answer = $host.ui.PromptForChoice($caption,$message,$choices,0)
if ($answer -eq 0) {
    .\Build-VM-Many.ps1 -SpecDir $SpecDir -Credential_CPR $Credential_CPR -Credential_VDC $Credential_VDC -Credential_Admin $Credential_Admin
} else {
    Write-Host "Build step aborted, run Build-VM-Many.ps1 manually to continue."
This script works well.  Now I need to add a section that adds Active Directory groups to the built servers from the spec document.  I found this script which also works well:
# Create local group on the local or a remote computer 
Write-Host -foregroundcolor Yellow 'Admin Privileges Required!' 
$computerName = Read-Host 'Enter computer name or press <Enter> for localhost' 
$localGroupName = Read-Host 'Enter local group name' 
$description = Read-Host 'Enter description for new local group' 
if ($computerName -eq "") {$computerName = "$env:computername"} 
if([ADSI]::Exists("WinNT://$computerName,computer")) { 
    $computer = [ADSI]"WinNT://$computerName,computer" 
    $localGroup = $computer.Create("group",$localGroupName) 
    $localGroup.SetInfo() 
    $localGroup.description = [string]$description 
    $localGroup.SetInfo() 
My question is, how do I make one script from the two?  I am very new to PowerShell scripting.

Here are the instructions on how to use PowerShell:
http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
Your question is vague and is asking for someone to do this for you.  It is better if you do it yourself and post back with specific questions.
In the end you have to write and debug the scripts. We will not do this for you but we will answer questions.
¯\_(ツ)_/¯

Similar Messages

  • Need Help With Combining Two Variables For A Redirect

    Hello-
    <br />
    <br />In a different part of my site (built with ADDT) I have this script that creates a variable by combining two session variables, and then the new variable is submitted into a mysqul database table using a hidden form field:
    <br />
    <br />
    <form>
    <input type="hidden" name="exerreference" id="exerreference" value="<?php echo $_SESSION['kt_login_user']; ?><?php echo $_SESSION['kt_exer_reference']; ?> <br />" />
    <br />
    <br />There is also this part of the script in the header script:
    <br />
    <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "POST", "exerreference");
    <br />
    <br />What I am trying to do now on another page is combine a session variable "kt_login_user" with a piece of dynamic text "AA" so that I can compare it to the field "exerreference" that was inserted into the database using the above script. If the two variables match, the idea is to have a redirect to another page.
    <br />
    <br />So in a hypothetical example, if the value of the session variable "kt_login_user " is "bestperson," and static text is "AA" then I need to create the variable bestpersonAA (because this is how the variables exist in the exerreference recordset). This variable bestpersonAA then needs to be compared to the recordset value exerreference and if they match, the page redirects to ../previous/portalpre.php. If the two variables do not match, then there is no redirect.
    <br />
    <br />Here is what I have so far:
    <br />
    <br />if (isset($_SESSION['kt_login_user']))
    <br />{
    <br />if ($_SESSION['kt_login_user'.'AA'] = $row_Recordsetexer1['exerreference'])
    <br />{
    <br /> header ("Location: ../previous/portalpre.php");
    <br />}
    <br />}
    <br />
    <br />The script doesn't work yet - it's redirecting regardless of if the two varibles match. Any ideas on the correct syntax to get this working correctly?
    <br />
    <br />Thanks
    <br />Dale</form>

    Hi Dale,
    if ($_SESSION['kt_login_user'.'AA'] = $row_Recordsetexer1['exerreference'])
    for checking whether two variables match, you´ll need the == comparison operator:
    if ($_SESSION['kt_login_user'.'AA'] == $row_Recordsetexer1['exerreference'])
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • APPLE SCRIPT HELP! Simple Renaming Script

    I dont have any experience with apple script but desperately needed this for a work issue. I basically have tons of files with all the same type of name and need to send the first two numbers in the file to the end of the file as a suffix... so this...
    01 alexa_02.mp3
    needs to turn into this
    01 alexa_02_01.mp3
    So the function is take the first two characters from the file name of all the files in the folder and rename them with a suffix. Here is what I have so far.
    PLEASE HELP! Im desperate!
    [CODE]try
        tell application "Finder" to set the source_folder to (choose folder with prompt "Pick the folder containing the files to rename:") as alias
    end try
    display dialog "Change Suffix to First Two Characters of File Name:" buttons {"Send The Pids!", "Cancel"}
    set the button_pressed to the button returned of the result
    set the item_list to list folder source_folder without invisibles
    set source_folder to source_folder as string
    repeat with i from 1 to number of items in the item_list
        set this_item to item i of the item_list
        set this_item to (source_folder & this_item) as alias
        set this_info to info for this_item
        set the current_name to the name of this_info
        tell application "Finder"
            if the button_pressed is "Send The Pids!" then
                set the filename to the (current_name & the characters 1 thru 2 of current_name) as string
                set orig to quoted form of POSIX path of current_name
                set dest to source_folder & filename
                try
                    set y to dest as alias
                on error
                    set dest to quoted form of POSIX path of dest
                    set command to "mv " & orig & " " & dest
                    do shell script command
                end try
            end if
        end tell
    end repeat[/CODE]

    Made a short script on my own... normally you could do this using the Finder and run a recursive algorythm, but if you just use find to find all files in a folder that ft your criteria and use these links to generate a list of aliases (posix files) it is way faster and acomplished with less code :-)
    set myfolder to characters 1 through -2 of (POSIX path of ((choose folder) as alias)) as text
    set foundfiles to every paragraph of (do shell script "find " & quoted form of myfolder & " -type f -iname \"*.mp3\"")
    repeat with afile in foundfiles
    set afile to ((afile as text) as POSIX file as alias)
    tell application "Finder"
    set filename to name of afile
    set filesuffix to (characters -4 through -1 of filename) as text
    set addonsuffix to characters 1 through 2 of filename
    set filename to (characters 1 through -5 of filename) as text
    set newfilename to filename & "_" & addonsuffix & filesuffix
    set name of afile to newfilename
    end tell
    end repeat

  • Need help in combining two similair SQLs into one

    DB Version:10gR2
    I need to combine the following two queries into one query and return the following three columns
    Unprocessed Quantity1,Unprocessed Quantity2, Total Uprocessed Cost
    Unprocessed Quantity1 can be determined using
    select t.ITEM, sum(t.QTY)
      from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
              from CONVEY_HDR ch, CURRENT_INVN cd, ALLOC_HDR ah
             where ........
            UNION
            select sd.ITEM_ID ITEM, sd.INVN_QTY QTY
              from shp_dtl pd
            UNION
            Select item_id, inv_qty from another table
        GROUP BY.....
    ITEM        SUM(T.QTY)
    88JAT                25
    000002395           1
    300108396          27
    000004397           7
    73984290           15Unprocessed quantity2 can be determined using
    select t.ITEM, sum(t.QTY)
         from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
                 from CONVEY_HDR ch, CURRENT_INVN cd, ALLOC_HDR ah
        where rownum<6
       group by t.ITEM
       order by t.ITEM;
    ITEM        SUM(T.QTY)
    189436171           2
    009438837         160
    000040685          16
    000032410          18Total Unprocessed Cost can found using the sum of Quantities for a particular Item from above two queries multiplied by
    ITEM_COST for that ITEM (which is found in ITEM_DTL table). For every item; ITEM_DTL.item_id=CARTON_dTL.carton_id
    Total Unprocessed Cost= (Unprocessed Quantity1+Unprocessed Quantity2)*ITEM_DTL. ITEM_COST
    Note: Unprocessed Quantity2 query looks very similair to first SQL in UNION of Unprocessed Quantity1, but ah.STAT_CODE < 90 for Unprocessed Quantity2 query
    Edited by: user636669 on Jan 14, 2009 10:40 AM
    Edited by: user636669 on Jan 14, 2009 10:57 AM
    Corrected typo
    Edited by: user636669 on Jan 14, 2009 7:07 PM

    Hi,
    Put the two queries you posted in sub-queries. You can then use their result sets as if they were tables.
    Do something like this:
    WITH  uq1  AS
        select t.ITEM, sum(t.QTY) AS total
          from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
                  from CASE_HDR ch, CASE_DTL cd, ASN_HDR ah
        ... the rest of your first query goes here
    ,     uq2  AS
        select t.ITEM, sum(t.QTY)  AS total
             from (select cd.ITEM_ID ITEM, cd.ACTL_QTY QTY
                     from CASE_HDR ch, CASE_DTL cd, ASN_HDR ah
        ... the rest of your second query goes here
    SELECT  uq1.item
    ,       uq1.total  AS "Unprocessed Quantity1"
    ,       uq2.total  AS "Unprocessed Quantity2"
    ,       (uq1.total + uq2.total) * dtl.item_cost
                       AS "Total Uprocessed Cost"
    FROM    uq1
    JOIN    uq2               ON uq1.item = uq2.item
    JOIN    item_dtl   dtl    ON uq1.item = dtl.item;If some items are in uq1 but not in uq2 (or vice-versa), then you'll probably want to do outer joins.
    I don't have any of the tables used, so I can't test this myself.
    If you need more help. then post a little sample data from each of the tables, and the results you want from that data.
    It looks like you're doing the same join in each of your original queries.
    You can add another sub-query that does that join once, and then use that sub-query in sub-queries uq1 and uq2.

  • Please help with combining two java packages into one iteration

    Hello, I work for a pharmaceutical company and run reports for credits that we have received. Currently the packages are reported seperately from the credit reports and my job is to combine them. There are two models that handle these and I need to link the second to the first with some common entities. Please help me figure out what I need to do in order to add a credit column to the report. I have a sample of the code below and would appreciate any help you can offer.
    First, the info pulled about the boxes:
    rm = (ReportManager) ManagerFactory.getManager(ManagerFactory.REPORTS);
    items = rm.getRVSSearchResults(hvstoresid,
    hvstoregroupsid,
    String.valueOf(request.getParameter("price_type")).trim(),
    String.valueOf(report_by).trim(),
    vendor_type,
    String.valueOf(request.getParameter("vendor")).trim(),
    from_date,
                        until_date,
    debitNum,
                        processing_type,
    sort_field,
    sort_direction,
                        includeAll222s).iterator();
    Second, the page that has the data i need to transpose to the first:
    PackoutModel pm = null;
                             int iter = searchpageposition*resultPageSize;
                             while (iter < packouts.size() && iter<(searchpageposition*resultPageSize)+resultPageSize)
                             { pm = (PackoutModel) packouts.get(iter);
                                  BigDecimal invoiceAmt = DataConverter.parseBigDecimalWithAlternateWhenNull(pm.getInvoiceAmt(),"0.00");
                                  BigDecimal creditRec = DataConverter.parseBigDecimalWithAlternateWhenNull(pm.getAmtReceived(),"0.00");
                                  BigDecimal processingFee = DataConverter.parseBigDecimalWithAlternateWhenNull(pm.getProcessFeeTotal(),"0.00");
                                  BigDecimal shippingFee = DataConverter.parseBigDecimalWithAlternateWhenNull(pm.getShippingHandlingFeeTotal(),"0.00");
                                  BigDecimal balanceDue =(invoiceAmt.add(processingFee.add(shippingFee))).subtract(creditRec);
    All that I need from the second page is to get a value for:
    DataConverter.parseBigDecimalWithAlternateWhenNull(pm.getAmtReceived(),"0.00");
    which I believe must first have the store id, etc equal to the first model. So there is the existing rvs.FOO and the needed pm.BAR but since it is in an iter loop, I can't seem to figure out how to join the two.
    Any ideas?

    could you explain your problem with a simplified schema or a more
    understandable code.
    (don't bother to write the details of your project plz)

  • I need help with combining two pdf files together but it won't let me in the latest Acrobat DC?

    Hi,
    I had two ai files, 11 by 17 on separate pages, and made them into pdf's. When I combine the files, it will let one out of the two files go through. The funny thing is that it will let the larger file go through than the smaller file. The file that went through had been in  ai, dropped it into photoshop and put it back into ai again. The file that won't go through is a quote with different text. What should I do? What does pdf/a, pdf/x, pdf/e and preflight mean?
    Thank you

    Make sure neither of the PDF have been secured in some manner like password protection, form rights or forms distribution.
    Forms created with live cycle cannot be combined by Acrobat.

  • Combining two illustrator scripts

    Hi I have one problem. i dont know javascript but i neet to combine two scripts in one.
    first script:
    var doc = app.activeDocument;
    var docname = (doc.name.split('.'))[0]; // name
    var doc_artboard = doc.artboards[0].artboardRect;
    if (app.documents.length > 1) {
            alert( "Please close other documents, and run the script again");
    } else {
        var ok = confirm( "Please save your original file before continue.\n\nLayer files will be saved in the same folder as the original file. Original file will be closed without saving.\n\nContinue?" );
        if (ok) {
            // prepare layers
            for(var i=0; i<doc.layers.length; i++) {
                doc.layers[i].visible = false;
            // go through each layers
            for(var i=0; i<doc.layers.length; i++) {
                app.activeDocument = doc;
                if (i>0) doc.layers[i-1].visible = false;
                doc.layers[i].visible = true;
                doc.activeLayer = doc.layers[i];
                saveAI( doc.path, doc.activeLayer.name, i );
            // close original file without saving
            doc.close( SaveOptions.DONOTSAVECHANGES );
    function saveAI( path, name, id ) {
        var currlayer = doc.layers[id];  
        var g = currlayer.groupItems.add();
        group( g, currlayer.pageItems );  
        var t = g.top;
        var l = g.left;
        var newdoc = app.documents.add ( doc.documentColorSpace, doc.width, doc.height);
        newdoc.artboards[0].artboardRect = doc_artboard;
        var newlayer = newdoc.layers[0];
        g.duplicate( newlayer, ElementPlacement.PLACEATBEGINNING );
        newlayer.pageItems[0].top = t;
        newlayer.pageItems[0].left = l;
        path.changePath( docname+"_"+name+".ai" );
        newdoc.saveAs( path );
        newdoc.close( SaveOptions.DONOTSAVECHANGES );
        // wait for the new file to save and close before continue.
        // A callback function (if possible) will be better than a while loop for sure.
        while (app.documents.length > 1) {
            continue;
    function group( gg, items ) {
        var newItem;
        for(var i=items.length-1; i>=0; i--) {
            if (items[i]!=gg) {
                newItem = items[i].move (gg, ElementPlacement.PLACEATBEGINNING);
    the second one:
    if (app.documents.length > 0) {
         var docRef = app.activeDocument;
         if (docRef.artboards.length > 1)
              alert('Need exactly one artboard');
              quit;
         // Found 1 artboard
         var myVisibleBounds = docRef.pageItems[0].visibleBounds;
         // The VisibleBounds rect is in this order: left, right, top, bottom
         // so use variables to show which side we are using
         var myLeft = 0;   var myRight = 1;   var myTop = 2;   var myBottom = 3;
         for ( var i = 1; i < docRef.pageItems.length ; i += 1 )
              // We want the ultimate maximum bounds, so select the minimum left and bottom, and max right and top of our rect.
              myVisibleBounds[myLeft  ] = Math.min( myVisibleBounds[myLeft  ], docRef.pageItems[i].visibleBounds[myLeft  ] );
              myVisibleBounds[myRight ] = Math.max( myVisibleBounds[myRight ], docRef.pageItems[i].visibleBounds[myRight ] );
              myVisibleBounds[myTop   ] = Math.max( myVisibleBounds[myTop   ], docRef.pageItems[i].visibleBounds[myTop   ] );
              myVisibleBounds[myBottom] = Math.min( myVisibleBounds[myBottom], docRef.pageItems[i].visibleBounds[myBottom] );
         // We have our maximum bounds, so use it to set the document's (only) artboard
         docRef.artboards[0].artboardRect = myVisibleBounds;
    else {
         alert('Open a document before running this script', 'Error running FitArtboardToArt.jsx');
    Anyone cn help me please.

    if (app.documents.length > 0) {
         var doc = app.activeDocument;
         if (doc.artboards.length > 1)
              alert('Need exactly one artboard');
              quit;
         // Found 1 artboard
         var myVisibleBounds = doc.pageItems[0].visibleBounds;
         // The VisibleBounds rect is in this order: left, right, top, bottom
         // so use variables to show which side we are using
         var myLeft = 0;   var myRight = 1;   var myTop = 2;   var myBottom = 3;
         for ( var i = 1; i < doc.pageItems.length ; i += 1 )
              // We want the ultimate maximum bounds, so select the minimum left and bottom, and max right and top of our rect.
              myVisibleBounds[myLeft  ] = Math.min( myVisibleBounds[myLeft  ], doc.pageItems[i].visibleBounds[myLeft  ] );
              myVisibleBounds[myRight ] = Math.max( myVisibleBounds[myRight ], doc.pageItems[i].visibleBounds[myRight ] );
              myVisibleBounds[myTop   ] = Math.max( myVisibleBounds[myTop   ], doc.pageItems[i].visibleBounds[myTop   ] );
              myVisibleBounds[myBottom] = Math.min( myVisibleBounds[myBottom], doc.pageItems[i].visibleBounds[myBottom] );
         // We have our maximum bounds, so use it to set the document's (only) artboard
         doc.artboards[0].artboardRect = myVisibleBounds;
    else {
         alert('Open a document before running this script', 'Error running FitArtboardToArt.jsx');
    //Saves out layers as seperate files
    var docname = (doc.name.split('.'))[0]; // name
    var doc_artboard = doc.artboards[0].artboardRect;
    if (app.documents.length > 1) {
            alert( "Please close other documents, and run the script again");
    } else {
        var ok = confirm( "Please save your original file before continue.\n\nLayer files will be saved in the same folder as the original file. Original file will be closed without saving.\n\nContinue?" );
        if (ok) {
            // prepare layers
            for(var i=0; i<doc.layers.length; i++) {
                doc.layers[i].visible = false;
            // go through each layers
            for(var i=0; i<doc.layers.length; i++) {
                app.activeDocument = doc;
                if (i>0) doc.layers[i-1].visible = false;
                doc.layers[i].visible = true;
                doc.activeLayer = doc.layers[i];
                saveAI( doc.path, doc.activeLayer.name, i );
            // close original file without saving
            doc.close( SaveOptions.DONOTSAVECHANGES );
    function saveAI( path, name, id ) {
        var currlayer = doc.layers[id]; 
        var g = currlayer.groupItems.add();
        group( g, currlayer.pageItems ); 
        var t = g.top;
        var l = g.left;
        var newdoc = app.documents.add ( doc.documentColorSpace, doc.width, doc.height);
        newdoc.artboards[0].artboardRect = doc_artboard;
        var newlayer = newdoc.layers[0];
        g.duplicate( newlayer, ElementPlacement.PLACEATBEGINNING );
        newlayer.pageItems[0].top = t;
        newlayer.pageItems[0].left = l;
        path.changePath( docname+"_"+name+".ai" );
        newdoc.saveAs( path );
        newdoc.close( SaveOptions.DONOTSAVECHANGES );
        // wait for the new file to save and close before continue.
        // A callback function (if possible) will be better than a while loop for sure.
        while (app.documents.length > 1) {
            continue;
    function group( gg, items ) {
        var newItem;
        for(var i=items.length-1; i>=0; i--) {
            if (items[i]!=gg) {
                newItem = items[i].move (gg, ElementPlacement.PLACEATBEGINNING);

  • Help with two scripts - Mounting remote DMG and Checking which network I'm connected to

    Hey guys, I need some help with two separate scripts:
    1. The first script I'm trying to create to mount a DMG stored remotely on another Mac using an AppleScript or shell script. Using the following:
    set cmd to "hdiutil mount 'afp://username:[email protected]/Lion/Users/username/Desktop/Test.sparseim age'"
    do shell script cmd
    results in the following error:
    error "hdiutil: mount failed - not recognized" number 1
    I'm not very experienced regarding AppleScript or using hdiutil, could somebody point out what's wrong with my script?
    2. The second script I'm working on to try and essentially prevent the 'Could Not Find Server' Finder dialog when a network mount is unavailable. I guess what I'd like it to do is detect which network I'm connected to, and if I'm connected to the correct network, then mount the shares, otherwise just fail silently without any errors. From the searching I've done, using try statements should do this, but they do not, and I'm still presented with an error dialog after the server cannot be found.
    Does anybody have any suggestions on this script? Also, I've seen some tips regarding detecting which wireless network the Mac is connected to, which could work, but what about when connected via Ethernet?
    Thanks!

    Edit: I need to clarify on my first script request:
    I need to mount the DMG on the remote Mac, not on the Mac I'm running the script from.

  • I have two script. one for indesign and another for photoshop. how can i merge both scripts?

    hi all,
    i have one script for indd which convert a user selected table as JPG (1276 px width, height varies). Second photoshop script which ask user to select jpg file and then check if pixel height is less than 1018 pixel, then it enlarge canvas size(height) to 1018 px.
    how can i combine both script, any tip or how to start would be helpful? The workflow should be:
    user select the table in indd document
    table export as jpg
    script will ask to select table jpg file or if it can be automated too that would be good.
    enlarge canvas height to 1018 px
    thanks
    virender
    PS: i already read the Java scirpt tool guide pdf but unable to understood

    Hi,
    I see two possible approaches here. The most logical would be to use a BridgeTalk Object that let you execute another app js code inside yoru primary app. In your case, you start your script from within InDesign and at some point the Photoshop specific script is executed thanks to the BridgeTalk Object.
    Other option is to use either AppleScrip or VB to execute the codes while targeting the specific app.
    Eventually, you may have your PS code in some external file and call $.evalFile when of course the file has a target instuction as Peter exposed.
    Once again, I think what you need is BridgeTalk.
    FWIW,
    Loic
    http://www.ozalto.com

  • Help with first Adobe Script for AE?

    Hey,
    I'm trying to create a script that will allow me to set a certain number of layer markers at an even interval to mark out a song. Could someone help me troubleshoot this script? I've been working on it for ages now, and I'm about to snap. I've basically gone from HTML and CSS, to javascript and Adobe scripting in the past few hours, and I cannot figure this out for the life of me.
    I want to create a dialog with two fields, the number of markers to place, and the tempo of the song. Tempo is pretty simple, its just the number of beats per minute. The script is meant to start at a marker that I have already placed, and set a new marker at incrementing times. Its mainly to help me see what I'm trying to animate too, even if the beat is a little hard to pick up every once in a while.
    Also, is there a better way to do this? This script will help me in the long run because I will need to do this pretty often, but I'm wondering if there was something that I could not find online that would have saved me these hours of brain-jumbling?
    Thank you very much for any help you can offer.
        // Neo_Add_MultiMarkers.jsx
        //jasondrey13
        //2009-10-26
        //Adds multiple markers to the selected layer.
        // This script prompts for a certain number of layer markers to add to the selected audio layer,
        //and an optional "frames between" to set the number of frames that should be skipped before placing the next marker
        // It presents a UI with two text entry areas: a Markers box for the
        // number of markers to add and a Frames Between box for the number of frames to space between added markers.
        // When the user clicks the Add Markers button,
        // A button labeled "?" provides a brief explanation.
        function Neo_Add_MultiMarkers(thisObj)
            // set vars
            var scriptName = "Neoarx: Add Multiple Markers";
            var numberOfMarkers = "0";
            var tempo = "0";
            // This function is called when the Find All button is clicked.
            // It changes which layers are selected by deselecting layers that are not text layers
            // or do not contain the Find Text string. Only text layers containing the Find Text string
            // will remain selected.
            function onAddMarkers()
                // Start an undo group.  By using this with an endUndoGroup(), you
                // allow users to undo the whole script with one undo operation.
                app.beginUndoGroup("Add Multiple Markers");
                // Get the active composition.
                var activeItem = app.project.activeItem;
                if (activeItem != null && (activeItem instanceof CompItem)){
                    // Check each selected layer in the active composition.
                    var activeComp = activeItem;
                    var layers = activeComp.selectedLayers;
                    var markers = layers.property("marker");
                    //parse ints
                    numberOfMarkers = parseInt (numberOfMarkers);
                    tempo = parseInt (tempo);
                    // Show a message and return if there is no value specified in the Markers box.
                    if (numberOfMarkers < 1 || tempo < 1) {
                    alert("Each box can take only positive values over 1. The selection was not changed.", scriptName);
                    return;
                    if (markers.numKeys < 1)
                    alert('Please set a marker where you would like me to begin.');
                    return;
                    var beginTime = markers.keyTime( 1 );
                    var count = 1;
                    var currentTime = beginTime;
                    var addPer = tempo/60;
                    while(numberOfMarkers < count)
                    markers.setValueAtTime(currentTime, MarkerValue(count));
                    currentTime = currentTime + addPer;
                    if (count==numberOfMarkers) {
                        alert('finished!');
                        return;
                    else{
                        count++;
                app.endUndoGroup();
        // Called when the Markers Text string is edited
            function onMarkersStringChanged()
                numberOfMarkers = this.text;
            // Called when the Frames Text string is edited
            function onFramesStringChanged()
                tempo = this.text;
            // Called when the "?" button is clicked
            function onShowHelp()
                alert(scriptName + ":\n" +
                "This script displays a palette with controls for adding a given number of markers starting at a pre-placed marker, each separated by an amount of time determined from the inputted Beats Per Minute (Tempo).\n" +
                "It is designed to mark out the even beat of a song for easier editing.\n" +
                "\n" +
                "Type the number of Markers you would like to add to the currently selected layer. Type the tempo of your song (beats per minute).\n" +           
                "\n" +
                "Note: This version of the script requires After Effects CS3 or later. It can be used as a dockable panel by placing the script in a ScriptUI Panels subfolder of the Scripts folder, and then choosing this script from the Window menu.\n", scriptName);
            // main:
            if (parseFloat(app.version) < 8)
                alert("This script requires After Effects CS3 or later.", scriptName);
                return;
            else
                // Create and show a floating palette
                var my_palette = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName, undefined, {resizeable:true});
                if (my_palette != null)
                    var res =
                    "group { \
                        orientation:'column', alignment:['fill','fill'], alignChildren:['left','top'], spacing:5, margins:[0,0,0,0], \
                        markersRow: Group { \
                            alignment:['fill','top'], \
                            markersStr: StaticText { text:'Markers:', alignment:['left','center'] }, \
                            markersEditText: EditText { text:'0', characters:10, alignment:['fill','center'] }, \
                        FramesRow: Group { \
                            alignment:['fill','top'], \
                            FramesStr: StaticText { text:'Tempo:', alignment:['left','center'] }, \
                            FramesEditText: EditText { text:'140', characters:10, alignment:['fill','center'] }, \
                        cmds: Group { \
                            alignment:['fill','top'], \
                            addMarkersButton: Button { text:'Add Markers', alignment:['fill','center'] }, \
                            helpButton: Button { text:'?', alignment:['right','center'], preferredSize:[25,20] }, \
                    my_palette.margins = [10,10,10,10];
                    my_palette.grp = my_palette.add(res);
                    // Workaround to ensure the editext text color is black, even at darker UI brightness levels
                    var winGfx = my_palette.graphics;
                    var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
                    my_palette.grp.markersRow.markersEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.FramesRow.FramesEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.markersRow.markersStr.preferredSize.width = my_palette.grp.FramesRow.FramesStr.preferredSize.width;
                    my_palette.grp.markersRow.markersEditText.onChange = my_palette.grp.markersRow.markersEditText.onChanging = onMarkersStringChanged;
                    my_palette.grp.FramesRow.FramesEditText.onChange = my_palette.grp.FramesRow.FramesEditText.onChanging = onFramesStringChanged;
                    my_palette.grp.cmds.addMarkersButton.onClick    = onAddMarkers;
                    my_palette.grp.cmds.helpButton.onClick    = onShowHelp;
                    my_palette.layout.layout(true);
                    my_palette.layout.resize();
                    my_palette.onResizing = my_palette.onResize = function () {this.layout.resize();}
                    if (my_palette instanceof Window) {
                        my_palette.center();
                        my_palette.show();
                    } else {
                        my_palette.layout.layout(true);
                else {
                    alert("Could not open the user interface.", scriptName);
        Neo_Add_MultiMarkers(this);

    You should ask such questions over at AEnhancers. I had a quick look at your code but could not find anything obvious, so it may relate to where and when you execute certain functions and how they are nested, I just don't have the time to do a deeper study.
    Mylenium

  • Two scripts not aligning correctly, 200px Width each, Link inside

    Hello all,
    I have a slight problem, I am attempting to align a twitter script and another script on one page, next to eachother, yet no matter how small I make the width of the style div, they remain on two individual alignments, one below the other.  I have attempted to close the first DIV after the second but to no avail.
    Link:
    http://entasistours.com/twitter.html
    Style:
    .debate{
    height:1000px;
    width: 200px;
    margin-top: 20px;
    margin-left: 8px;
    Code:
    <div class="clear"> </div>
    <div class="debate">
    <a class="twitter-timeline"  href="https://twitter.com/entasis" data-widget-id="268698405683994624">Tweets by @entasis</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id =id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(docu ment,"script","twitter-wjs");</script>
    </div>
    <div class="debate">
    <script>
    var idcomments_acct = 'e1b1a147378ac51e02992098d4ac0571';
    var idcomments_post_id;
    var idcomments_post_url;
    </script>
    <span id="IDCommentsPostTitle" style="display:none"></span>
    <script type='text/javascript' src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
    </div>
    <div class="footer">
    Many thanks in advance for any help.

    <div> is a block tag, as opposed to <span> which is an inline tag.  A block tag fills the width of its container, thereby forcing adjacent code to fall on a new horizontal line.  The only way to make two adjacent block tags sit on the same horizontal line is to float one or both of them.  To be floated, you must specify an explicit width and a float direction for each floated element in your CSS.  So for example,
    .debate {
    width:200px;
    height:1000px;
    margin:20px 0 0 8px;
    float:right;
    See if that does what you want.
    In addition, though, I also have to say that it's a very poor technique to assign an explicit height to any container that will have text content in it. The usual method is to let the contents determine the height of the container.

  • UCCX Scripting Question- combining multiple scripts into one -Transfers/subflows

    I need to separate an existing call center into two because their hours are different and the main lines have separate DIDs.
    The two separate call centers must have the same agents and same queues, including Agent Personal Queues as Menu options. Callers need to be able to choose to go to either the Main Queues, or listen to another menu that allows them to select and option to be sent to a personal queue
    I have three separate scripts, CCA, CCB, and Agent Personal Queue, same queues, same switch (calledNumber) with the same trigger(DNs) and I was about to create three separate applications, but then realized the triggers can only point to one application
    What is the best way to set this up?
    Option A
    Script A (CCA )- Has all the "Switch-(Called Number) with all the trigger
    Script B -Has no Switch, just Transfer to extension(and then the call goes out to the trigger)
    Script C - is the Personal Queue Script
    Option B
    Combine all three scripts into one-separate the TOD logic, have the same queues and menus beneath each call center and Personal Queue tree, is going to be a really large file

    Hello-
    I would likely use a single script for your application.  That being said looking at your screenshot it looks like your script could use some clean up and consolidation.
    DJ

  • Two script in one driverprogram

    can tell me the scenario with
    function module to write two script in one driverprogram
    Edited by: Alvaro Tejada Galindo on Jan 30, 2008 4:19 PM

    Hi,
      These are following steps to call two forms in one driver program.
    1. call funtion open_form FM.
    2. call function start_form FM.
       specify the first form name and page number of form to be called first.
    3. call write_form to put data into form.
    4. call function end_form.
    5. call funtion start_form.
        specify the second form  name and page number of form to be called second.
    6.call write_form.
    7. call function end_form.
    8. finally call funtion close_form.
    try this , i hope it will help u
    Thanks & Regards
    sathish

  • Script help -- to change the path of some script

    hi
    is it possible to make a script(perl or shell) which will change the location of sql script those are called from different shell script?
    i have some shell script which is calling some sql scripts.now i need one script which will ask for the path of those script once and set the path of those sql script in those shell script.these shell script only containing a line
    "sqlplus / as sysdba @<path of the sql script>/script.sql" now i need one script which will change <path of the sql script> .is it possible to do ??
    i need some help from gurus ...
    rgrds
    Edited by: new2appsdba on Aug 20, 2010 7:16 PM

    Hi
    can you say how to pass this mpath to n number of shell script??
    i need to update n number of script.ie. i need to pass $mpath variable to n number of script.
    example:
    profile_chk.sh contain only :
    sqlplus apps/<pass> @/u02/uatdb/.DBA-Scripts/profile_chk.sqlprofile_chk.sql contain:
    SELECT A.PROFILE_OPTION_ID,A.LEVEL_ID,A.LEVEL_VALUE,A.PROFILE_OPTION_VALUE,V.USER_PROFILE_OPTION_NAME
    FROM APPS.FND_PROFILE_OPTION_VALUES A, APPS.FND_PROFILE_OPTIONS_VL V
    WHERE A.PROFILE_OPTION_ID =V.PROFILE_OPTION_ID
    AND V.USER_PROFILE_OPTION_NAME like '%Debug Log%';
    select t.user_profile_option_name, profile_option_value
    from apps.fnd_profile_options o
    ,apps.fnd_profile_option_values v
    ,apps.fnd_profile_options_tl t
    where o.profile_option_id = v.profile_option_id
    and o.application_id = v.application_id
    and profile_option_value = 'Y'
    and start_date_active = SYSDATE
    and o.profile_option_name = t.profile_option_name
    and level_id=10001
    and (upper(t.user_profile_option_name) like '%PERSONALIZ%'
    and upper(t.user_profile_option_name) not like '%PERSONALIZ%WYSIWYG%'
    order by user_profile_option_name;
    select t.user_profile_option_name, profile_option_value, application_name
    from apps.fnd_profile_options o
    ,apps.fnd_profile_option_values v
    ,apps.fnd_profile_options_tl t
    ,apps.fnd_application_tl a
    where o.profile_option_id = v.profile_option_id
    and o.application_id = v.application_id
    and profile_option_value = 'Y'
    and start_date_active = SYSDATE
    and o.profile_option_name = t.profile_option_name
    and a.application_id = level_value
    and level_id=10002
    and t.language = a.language
    and upper(t.user_profile_option_name) like '%PERSONALIZ%'
    order by user_profile_option_name, application_name;now i need a script say install.sh
    which will update the location of profile_chk.sql in the profile_chk.sh.
    this install.sh will contain n numbers of
    install -c profile_chk.sh /usr/bin so that all user can access this shell script as a command.
    whenever the testing goes one server contains two instance so each everytime i need to monitor locks and invalid objects and etc so i need to use this scripts as a commands.for that reason i need this install -c for each scripts.and i need to visit different places also.so ineed this install.sh.my idea is basically work properly once and enjoy times lazily :-) so whenever i move to new place i shall only run this install.sh once and use those scripts lazily.
    rgrds

  • Script help for dated folder/file

    would anyone mind helping me finalize an issue i have been needing to finalize? i have gotten some help on creating a script that creates a file or folder with the current date but i am not technically competent enough with applescript or chron or any of these things. i can handle terminal pretty much but some of the explanations while obviously complete have got me confused.
    can anyone take a look at the first one here and just tell me how to get off the blocks with this?
    apparently i need to /copy/ and paste the text into a text editor and save as a .pl file by converting the file extension or is this wrong? it seems to me like the next step is in terminal so with a question or two i am sure i can handle this second part...
    https://discussions.apple.com/message/18109918#18109918
    this is another version but the first seems like i have more editing control or may be more direct for my needs(?).
    https://discussions.apple.com/thread/3526097?start=15&tstart=0

    Well, since you have issues with copying, pasting, and saving a file in the GUI, the second option may be your best choice. Setting up crontab requires some proficiency using the vi text editor.

Maybe you are looking for

  • OAF Update of Custom Table causing ORA-600 with database block corruption?

    Using OA Framework 12.1.3, running under EBusiness Suite 12.1.3 Created Custom Web page operating against Custom Tables ISSUE On about 2% of new records, when OAF is UPDATING a record in a certain table, it  is failing with java.sql.SQLException: ORA

  • My simpletech external hard drive shows up in disk utility on one macbook pro but not my other one.  how do i fix this???

    I have two macbook pro computers.  My external HD was reformatted on one of them from a PC to MAC.  It shows up just fine on this macbook.  The other macbook, I cannot find it.  Ive tried in disk utility and Ive tried to see if it was hidden.  Cannot

  • How to factory reset iphone4

    I found a iphone 4 or 4s im not sure...but anyway i was try to unlock it but i cant unlock it because it says to log in with the apple id but it is already under some one elses apple id...how do i get their id removed?

  • ESS  Payments Error

    Hello All, I'm getting an 'IndexOutof Bound' error on the 'Show Overview' Link of  of ESS >Payments and Benefits. Can anyone help with this? Regards, Kabir

  • FABridge.flash has no properties

    I'm in the process of building a controller swf application that I can embed in html type applications (like jsf) and then use the controller to communicate between a flex application and "launched" jsf applications. I'm using the FABridge to facilit