Need help to automate a script to create user

Hi people,

Environment: 10.2.0.4.0
Platform: Sun Solaris

I had to stop a few users (about 100) in my database. But before I did, I would save the user creation script as backup (just in case I need to re - create a user).

Toad can generate the script to create user as follows

CREATE USER TEST
  IDENTIFIED BY VALUES '**********'
  DEFAULT TABLESPACE PUBLISH
  TEMPORARY TABLESPACE TEMP_APP
  PROFILE APP_USERS
  PASSWORD EXPIRE
  ACCOUNT UNLOCK;
  -- 2 Roles for TEST
  GRANT CONNECT TO TEST;
  GRANT E_READONLY TO TEST;
  ALTER USER TEST DEFAULT ROLE ALL;
However, it is simply too tedious to do it for each user. Can someone please suggest a solution more effeienct to generate the script to create user using PL/SQL, script etc?

Thanks in advance

rogers42

DBMS_METADATA. GET_DDL

Long value 1000000000

Select dbms_metadata.get_ddl ('USER', username)
from dba_users
where

There are other functions in this package to other things you list.

-----------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

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

    Hello

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

    Thank you

    KR

    Try this instead:

    $vmsInfo = Get-VM
    #Creating array to place new object
    
    $reportdata = @()
    
    Foreach ($vm in $vmsInfo)
    {
    #Creating new object
    $vmInfo = "" | Select Name, CPUReservationMHz, MemoryReservationGB
    $vmInfo.Name = $vm.Name
    $vmInfo.CPUReservationMHz = $vm.ExtensionData.ResourceConfig.CpuAllocation.Reservation
    $vmInfo.MemoryReservationGB = $vm.ExtensionData.ResourceConfig.MemoryAllocation.Reservation / 1024;
    #Inserting data into new object.
    $reportdata += $vminfo
    }
    $reportdata
    
  • 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 understanding PowerCli scripting by LucD

    Hello

    I'll give you the standard statement that I am a noob powercli and don't really know what I'm doing here.  Here's a script that works because it runs without error and gives a report but I need help to understand this under his weight.

    Connect-VIServer '< our vcenter >' - user < user > admin-password < admin-user-pwd >

    $allvms = @)

    $vms = get - Vm | where {$_.} PowerState - eq "Receptor"}

    $start = (get-Date). AddDays(-1)

    $metrics = "mem.usage.average".

    $stats = get-Stat-entity $vms - start $start - Stat $metrics

    $stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{

    $vmstat = "" | Select the day, MemAlloc, MemMin, MemMax, MemAvg, VmName

    $vmstat. VmName = $_. Values [1]

    $vmstat. Day = $_. Group [0]. Timestamp.Date

    $mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum

    $vmstat. MemMax = [int] $mem. Maximum ##dfsdf

    $vmstat. MemAvg = [int] $mem. Average

    $vmstat. MemMin = [int] $mem. Minimum

    $vmstat. MemAlloc = $_. Group [0]. Entity.MemoryMB

    $allvms += $vmstat

    }

    $allvms |

    Export-Csv "c:\ < folder > \ <>.csv file Destination"-noTypeInformation

    It connects to our server vcenter server and offers two days of data.  Today and yesterday, all with a timestamp of 0:00.  See below for an example of a virtual machine.

    VmNameDayMemAllocMemMaxMemAvgMemMin
    < name VM1 >07/05/2016 0:004096181818
    < name VM1 >06/05/2016 0:0040963612

    8

    The MemMax, the MemAvg and the MemMin are for this day?  Just the max of this period of sampling time 0:00?

    What I'm looking for, it is to find that the use of the maximum memory of virtual machines are for the whole day.  So I hope that I can remove memory of VMs that do not use it.  I was listed on the change $start = (Get-Date). The value of AddDays(-1) to $start = (Get-Date). AddDays(-30) and see what things alike.  I want to be sure however that the value for MemMax is the highest value for a period of 24 hours.  That is to say for the 07/05/2016 the given virtual machine never used a maximum of 18% of his memory attributed the 06/05/2016 the maximum amount of memory used was 36%, and so on that I extend on the date range.

    Kind regards

    Michael

    It then becomes a rather simple Get-Stat script.

    $vms = get - Vm | where {$_.} PowerState - eq "Receptor"}

    $start = (get-Date). AddDays(-1)

    $metrics = "mem.usage.average".

    Get-Stat - entity $vms - start $start - Stat $metrics |

    Select Timestamp,@{N='VM'; E={$_. @entity.name}}, Value |

    Tri-objet-VM property |

    Export-Csv "c:\------.csv '-noTypeInformation

  • Need help with a virtual machine between multiple users on iMac even...

    So I installed Fusion on my Intel iMac and created a virtual machine that uses Windows Vista. My problem is that I need to have two accounts Admin on Mac can use Vista/Fusion. I read a little about it and tried to put the virtual machine folder in the Documents of the other admin folder. Then I logged in as the admin account and Fusion found the records of the virtual machine and loaded vista fine. But of course now the first admin account cannot open Vista more. My question is can I copy the VM "Bundle" in the documents of the other account, so both users have files? Or with this screw things?

    Or should I put the virtual machine 'bundle' in the shared folder to make it work as I need to? I know that the two users can access the same VM at the same time, but as long as a user stop Vista and the merger and disconnects, can another user log in and open Vista/Fusion?

    Help, please! Thanks in advance.

    The Beginner Guide to VMware Fusion: sharing a VM between users

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

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

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

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

    Thank you.

    vram.JPG

    Try something like this

    Get - VM |

    Select Name,

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

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

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

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

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

    }} |

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

  • Need help making vMotion smarter script

    Here's my current script;

    variable #define
    $sourcehost = "hostname."
    $desthost = "hostname."
    $destlun = "lun."
    $vm = 'virtualmachine '.

    # Move VM new host with svMotion capabilities
    Get - VM $vm | Move-VM-Destination (Get-VMHost $desthost)

    # Move the VM to the new data store using svMotion
    Get - VM $vm | Move-VM - Datastore (Get-Datastore $destlun) - DiskStorageFormat "thin".

    # Move VM back to the original host
    Get - VM $vm | Move-VM-Destination (Get-VMHost $sourcehost)

    What I need to do, is make smarter so that I can call the script and the input of the command line variables. For example;

    .\vMotion.ps1 indicates DestHost DestLUN VM

    Is it possible that I can get this to work?

    Kind regards

    Paul

    Hello, logiboy123-

    You can use 'param' at the beginning of your script to set parameters for the script.  As:

    param(    [string]$sourceHost,    [string]$destHost,    [string]$destLUN,    [string]$vm)
    

    This creates ' named parameters' for the script.  You can use the parameters like:

    .\vMotion.ps1 -sourceHost MySourceHost01 -destHost MyDestHost22 -destLUN ssdLUN02 -vm vmToMove
    

    By default, these settings are also positions in the order that they are listed in the "param" statement in the start menu of the script.  In other words, you can use them when you call the script without specifying the parameter names.  For the sake of clarity and to ensure that the script uses the settings I want to, I prefer to use the names of parameters when calling the script, but which is, of course, to you.

    For more help, on the parameters and some of the other attributes of the parameter that you can use for help on 'about_Functions_Advanced_Parameters.

  • 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 with files combining script

    Hey guys, I'm a graphic designer who is really hoping most commonly the code can someone help! I have several hundred images that need to be combined. A client gave me a folder of images and their alpha cards as separate files. I need combine each image and alpha map and export the new image format PNG 24 with transparency. Doing so by hand will take forever, do this with a script is going to be awesome. The script must:

    -Open Filename.png

    -Create a duplicate of the background layer (as background layers may not have masks it seems)

    -Remove the background layer

    -Add a layer mask to the new double layer

    -Open filenamea.png (the alpha cards follow convention assignment of names + a .png file name)

    -Copy filenamea.png into the layer mask to filename.png

    -Save the filename.png for Web and devices such as a PNG 24 with transparency in a folder called converted (to avoid overwriting the old image)

    I'm sure it's more complicated, it seems, but is - someone up to help a poor, illiterate code GD?

    Here's a JavaScript solution only, for the curious. Save it as MergeAlpha.jsx and run it from Photoshop.

    X

    function cTID(s) { return app.charIDToTypeID(s); };
    function sTID(s) { return app.stringIDToTypeID(s); };
    
    function main() {
    
      var folder = Folder.selectDialog();
      if (!folder) {
        return;
      }
    
      var ofolder = new Folder(folder + "/Converted");
      ofolder.create();
    
      var saveOpts = new ExportOptionsSaveForWeb();
      saveOpts.format = SaveDocumentType.PNG;
      saveOpts.PNG8 = false;
      saveOpts.transparency = true;
    
      var pngs = folder.getFiles('*.png');
    
      for (var i = 0; i < pngs.length; i++) {
        var file = pngs[i];
        var afile = new File(folder + '/' + file.name.replace('.png', 'a.png'));
        if (!afile.exists) {
          continue;
        }
    
        var doc = app.open(file);
        doc.activeLayer.isBackgroundLayer = false;
        var adoc = app.open(afile);
        adoc.selection.selectAll();
        adoc.selection.copy();
        adoc.close(SaveOptions.DONOTSAVECHANGES);
    
        createLayerMask();
        selectMaskChannel();
        doc.paste();
    
        var ofile = new File(ofolder + '/' + file.name);
        ofile.remove();
        doc.exportDocument(ofile, ExportType.SAVEFORWEB, saveOpts);
        doc.close(SaveOptions.DONOTSAVECHANGES);
      }
    };
    function createLayerMask() {
        var desc9 = new ActionDescriptor();
        desc9.putClass( cTID('Nw  '), cTID('Chnl') );
            var ref6 = new ActionReference();
            ref6.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') );
        desc9.putReference( cTID('At  '), ref6 );
        desc9.putEnumerated( cTID('Usng'), cTID('UsrM'), cTID('RvlA') );
        executeAction( cTID('Mk  '), desc9, DialogModes.NO );
    };
    function selectMaskChannel() {
        var desc26 = new ActionDescriptor();
            var ref18 = new ActionReference();
            ref18.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') );
            ref18.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
        desc26.putReference( cTID('null'), ref18 );
        desc26.putBoolean( cTID('MkVs'), true );
        executeAction( cTID('slct'), desc26, DialogModes.NO );
    };
    
    main();
    
  • Need help with changing PowerCLI script to get the interface driver NETWORK &amp; firmware version?

    Hi all

    mattboren created the script below for a list of BIOS hardware version and firmware version:

    ## Script function: quickly get BIOS date, Smart Array FW version, and iLO FW version for HP hosts in a given location (folder, cluster, datacenter, etc.)
    ## Author: vNugglets.com -- Sep 2011
    
    ## folder in which hosts in which we are interested reside
    #$strHostsFolderName = "myFolder"
    #Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType Folder -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsFolderName))$"}).MoRef | %{
    ## cluster in which hosts in which we are interested reside
    
    $strHostsClusterName = "Production"
    Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType ClusterComputeResource -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsClusterName))$"}).MoRef | %{
        $arrNumericSensorInfo = @($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo)
        # HostNumericSensorInfo for BIOS, iLO, array controller
        $nsiBIOS = $arrNumericSensorInfo | ? {$_.Name -like "*System BIOS*"}
        $nsiArrayCtrlr = $arrNumericSensorInfo | ? {$_.Name -like "HP Smart Array Controller*"}
        $nsiILO = $arrNumericSensorInfo | ? {$_.Name -like "Hewlett-Packard BMC Firmware*"}
        $nsiNXdev = $arrNumericSensorInfo | ? {$_.Name -like "nx_nic device*"}
        $nsiNXdrv = $arrNumericSensorInfo | ? {$_.Name -like "nx_nic driver*"}
    
      if ( $nsiNXdev.Count -gt 0 ) {
           $nsiNXdevice = $nsiNXdev[0].Name
      } else {
           $nsiNXdevice = "n/a"
      }
      if ( $nsiNXdrv.Count -gt 0 ) {
           $nsiNXdriver = $nsiNXdrv[0].Name
      } else {
           $nsiNXdriver = "n/a"
      }
    
        New-Object PSObject -Property @{
            VMHost = $_.Name
            "SystemBIOS" = $nsiBIOS.name
            "HPSmartArray" = $nsiArrayCtrlr.Name
            "iLOFirmware" = $nsiILO.Name
            "nx_nic device" = $nsiNXdevice
            "nx_nic driver" = $nsiNXdriver
        } ## end new-object
    } | Export-Csv C:\temp\Production-BLadeG7.csv  ## end Foreach-Object
    
    
    
    
    

    However, I would like to change the driver for the CARD and the version of the firmware but still appear.

    Any kind of help and suggestions would be greatly appreciated.

    Thank you.

    Try like this

    $strHostsClusterName = 'production '.

    Get-view ViewType - HostSystem-Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo - SearchRoot (Get-View - Name ClusterComputeResource-property - ViewType filter @{'Name' = ' ^ $([RegEx]: escape ($strHostsClusterName)) $"" "}). MoRef | %{

    $arrNumericSensorInfo = @($_.) Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo)

    # HostNumericSensorInfo for controller table of BIOS, ILO,

    $nsiBIOS = $arrNumericSensorInfo |? {$_. {Name: like "* system BIOS *"}

    $nsiArrayCtrlr = $arrNumericSensorInfo |? {$_. {Name - like "HP Smart Array Controller *"}

    $nsiILO = $arrNumericSensorInfo |? {$_. {Name - like "Hewlett-Packard BMC Firmware *"}

    $esxName = $_. Name

    $esxcli = get-EsxCli - VMHost $_. Name

    $esxcli.network.nic.list () | %{

    $esxcli.network.nic.get ($_.) Name) | %{

    $props [ordered] = @ {}

    VMHost = $esxName

    "SystemBIOS" = $nsiBIOS.name

    "HPSmartArray" = $nsiArrayCtrlr.Name

    "iLOFirmware" = $nsiILO.Name

    "nx_nic device" = $_. Name

    'nx_nic pilot' = $_. DriverInfo.Driver

    "nx_nic driver version" = $_. DriverInfo.Version

    "nx_nic firmware version" = $_. DriverInfo.FirmwareVersion

    } # end new object

    New-object PSObject-property $props

    }

    }

    } | Export-Csv C:\temp\Production-BLadeG7.csv # end Foreach-Object

  • I need help with my first Script in AE CS5

    Hello fellow designers out there.

    I'm newbie on AE Scripting here. I run my CS 5 on Win 7. I'm trying to create a simple solid GUI and it controls opacity by cursor. I fail and do not now how it work. Here is the code that I have written in reference to many sources and tutorials:

    myComp = app.project.item (1); akses comp 1

    mySolid = myComp.layers.addSolid ([1.0,1.0,0], 'my place', 50, 50, 1); solid

    var myWin = new window ("palette", "Transform", undefined); create the palette

    myWin.orientation = "row";

    var myOpacity = myWin.add ('Committee', undefined, "Strong opacity");

    myOpacity.orientation = "column";

    myOpacity.add ("statictext", undefined, "Opacity Kontrol");

    var opacitysliderCtrl = myOpacity.add ("slider", undefined, 50, 0, 100); make cursor

    var layerOpacity = mySolid.property ("opacity");

    opacitysliderCtrl.onChanging = function()

    {

    var val = Math.round (opacitysliderCtrl.value);

    layerOpacity.value = val;

    };

    myWin.center ();

    myWin.show ();

    Please, help me to see the problem here. Thank you

    There is more harm than good in your work

    At the moment you script attached a slider to a single layer (mySolid, that you add at the beginning).

    This is not very useful, that you cannot use this slider for the other layers.

    You should also keep in mind that this solid can be deleted, so the mySolid object may become invalid (referring to a solid that no longer exists).

    I don't know what, exactly, is your plan, but a script has generally not set anything related to AE in his many body (at launch).

    Only when the user clicks/change a widget script tries to extract a model, layer, property, or anything that the user specified by "a kind of secret code" (most of the time: the model, property, layer, etc. is selected).

    If you want the slider to control the opacity value of all selected layers in the active model, it would be something like this:

    var myWin = new Window("palette", "Transform", undefined); //create pallete
    myWin.orientation = "row";
    
    var myOpacity = myWin.add("panel", undefined, "Solid Opacity");
    myOpacity.orientation = "column";
    
    myOpacity.add("statictext", undefined, "Kontrol Opacity");
    
    var opacitysliderCtrl = myOpacity.add("slider", undefined, 50, 0, 100);//make slider
    opacitysliderCtrl.onChanging = function onOpacitySliderChanging(){
    
            // retrieve the AE things that have to be handled: in this case, all selected layers in the active comp
            var myComp, myLayer, n;
            var layerOpacity, val;
    
            myComp = app.project.activeItem;
            if (myComp.numLayers>0){
                for (n=0; n
    

    Xavier

  • Need help with vSphere data script, packaging and sending it to the data warehouse

    Greetings PowerCLI gurus.


    Everyone can offer suggestions on a script which can query vSphere and pull on the following fields of the virtual computer:

    NameStateStatusHostSpace in useSpace used

    Format in a file in the CSV format and send the file to an FTP server?

    Much respect to all, thanks a lot in advance.

    Hello-

    Happy to help you.

    OK, well, if this database is accessible through a UNC path, you might make a copy directly using Copy-Item.  If you use different credentials, you can encrypt and store in an XML file.  HAL Rottenberg wrote to do http://halr9000.com/article/531.

    Or, if this pension data is something that supports the secure copy (scp) or secure FTP (SFTP), those who would be good options.  Again, you can store the alternative credentials in an encrypted in an XML file format and use them as needed.

    Certainly, there is a balance to be struck between security and ease of use.  It may be such that the transmitted data are not considered sensitive to all, and clear data transfers are acceptable.  Probably still a good idea to take measures to protect the credentials at least.

  • Need help to optimize this script.

    Hello

    I use ID CS5 on Windows7.

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

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

    It has a few obvious repitations and is ineffective.

    Please help me optimize it.

    myDocument var = app.activeDocument;

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

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

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

    {

    currItem = myPage.pageItems.item (i);

    If (currItem.label is "ParentText")

    {

    source var = currItem.contents;

    }

    }

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

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

    {

    currItem = myPage.pageItems.item (i);

    If (currItem.label! = "ParentText")

    {

    currItem.contents = source;

    }

    }

    Hello

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

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

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

    Arrival to the string table returns a string,

    Search method returns the index

    Slice method cut the string.

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

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

    Jarek

  • Need help with custom calculation Script

    Hey everybody.  I'm using Acrobat X Pro and stumbling a bit on the syntax of the following equation.  I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3.  However, the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 &"Cell2".  For example: If the user enters "3" in "Cell3" I need the value returned at 3% of the sum of "Cell1" + "Cell2".  If the user enters "9" in "Cell3" I need the value returned for "Cell3" 9% of the sum of "Cell1 and Cell2" and the end result should be the sum of "Cell1 Cell2 + Cell3.  In more detail:

    If "Cell1" = "Cell2" $ 500 = $500 and "Cell3" = '3' then I need the returned value to be $1030,00.

    I hope this makes sense. Here's what I have so far, but alas, it does not work.  Any help would be GREATLY appreciated.

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;

    Get the value of a field, a number transformation

    var v3 = + getField("Cell3"/100).value;

    Calculate and set the value of this field for the result

    Event.Value = v3 + (v1 + v2);

    Thank you

    Solan

    I have posted a reply, but realized that it wasn't what you wanted. There is some confusion about what you want for Cell3. A hand, you say that the user enter a vaule in the area, but them you say you want its calculated value based on what the user has entered and two other field values. It seems to me Cell3 should be the domain that the user enters the percentage, and the calculated field (Cell4) script could be:

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;// get treatment field value, as a number

    Get the percentage

    var v3 = + getField("Cell3").value;

    Calculate and set the value of this field for the result

    Event.Value = (1 + v3 / 100) * (v1 + v2);

  • need help to run a script from cron

    Here's what I'm trying to get running (not the script complete, but all I need for this example):

    #! / bin/sh

    esxcfg-info - s & gt; /tmp/info.txt

    output

    This script works from the command line and info.txt is filled with loads of data. If I run it from cron, I don't get any errors, but the file has no data (0KB).

    I run other scripts of shell cron with no problems, but they are not call esxcfg orders. I guess that's because cron does not run as root as I am from the command line. Can anyone help to get this shell script to run or what do I need to get cron to complete (perhaps as root)? I don't want examples of perl, that my shell script is much more and I'm not a perl programmer, so I does the conversion.

    Thank you!

    You must specify the path complete the command that you try to run or any other entry Besides, since the projected TRACK can not set when the cron job started.

    who can help you locate that

    [root@himalaya Devastator-2009-05-22--2]# which esxcfg-info
    /usr/sbin/esxcfg-info
    

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

Maybe you are looking for

  • Cannot set up firefox sync easily on behalf of different funds (non-mobile)

    It seems almost impossible to set up firefox Sync. I try to use the synchronization so that my experience of Firefox is consistent between accounts on the same machine (IE Firefox in Windows and OSX - I'm under bootcamp on Macbook Pro). I'm not tryin

  • Is Satellite 1900 305 supports internal microphone

    Apologize in advance for what I'm afraid is a stupid question, but need a final answer before I spend more time investigating the potentially futile. Satellite 1900-305 has a built in microphone? I'm trying to get my friend (whose book it is) upward

  • ATTR_DIMMED (elements of the ring)

    Hello I'm confused (aging)... I want to fade the last item in a control of the ring. I had this in my wish list and according to my book keep it was not yet implemented, at least I couldn't figure out how to do it. On the other hand, the Date of issu

  • Windows Update error 646 code

    How can I get updates to install successfully? Tried to disable security, etc.

  • No its "no audio output device is installed".

    No noise and device controller found in the Manager and "no audio output device is installed"... no sound after automatic update from Microsoft