Script for grep that looks for the B of paragraph style paragraph style

Hello

I am fairly new to scripting in Indesign, and I ran across something I want script that I do not know how. Among the paragraph styles that are in our files are Normal and song. I need to add an extra paragraph return between all instances of normal followed by a song. I tried to search the forums to see if what was already here somewhere, and if it is I didn't come through it. I want to implement in the form of script grep, but if anyone has another way to do it, I would like to know also.

Thanks in advance

Hello

For example, you can use a script.

I guess a block of text with a correct history is selected and the history is in a setting or related frameworks.

....

monarticle = app.selection [0] .parentStory;

If (myStory.constructor.name! == 'Story')

{

Alert (' select a destination text block, then try to pls\rand ");

Exit();

}

myNormal = app.activeDocument.paragraphStyles.item ("Normal");

mySong = app.activeDocument.paragraphStyles.item ("Song");

app.findTextPreferences = null;

app.findTextPreferences.appliedParagraphStyle = mySong;

mFound = myStory.findText ();

Len = mFound.length - 1;

If (len > = 0)

While (len)-

{

currPara = .paragraphs mFound [len] [0];

If (.appliedParagraphStyle myStory.paragraphs.previousItem (currPara) is myNormal)

currPara.insertionPoints [0] .silence = "\r";

}

...

Rgds

Tags: InDesign

Similar Questions

  • How should be written the script for the use of the maximum memory of the guest operating system ever?

    How should be written the script for the use of the maximum memory of the guest operating system ever?

    Please teach the name of the object and the type and order, etc.

    You should be able to do it with the cmdlet Get-Stat .

    Something like that

    Get-Stat -Entity (Get-VM $vmName) -Stat mem.usage.maximum -Start (Get-Date).AddDays(-7) | Measure-Object -Property value -Maximum | Select Maximum
    

    This will return the maximum percentage in the last 7 days for the guests, whose name is stored in the variable $vmName.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Script for the Configuration DVSwitch

    Hello

    Someone at - it a script for the information of VDS on the level of the host which nic is connected to what uplink?

    Also to remove all Exchange created in the VDS switch for the host and then recreate the exchanges as they were after the connection to the host to a vCenter diff?

    Also any script to copy the resource through VCenter pools?

    Thank you

    Suraj Rawat

    The following script will export information of VDS for uplink, the port they are in and what Teddy is used by node ESXi.

    $report = {foreach ($dvSw in Get-VDSwitch)

    foreach ($esx in (Get-View-id $dvSw.ExtensionData.Summary.HostMember)) {}

    $proxy = $esx.Config.Network.ProxySwitch | where {$_.} {DvsUuid - eq $dvSw.ExtensionData.Uuid}

    $pnicTab = @ {}

    $proxy. Spec.Backing.PnicSpec | %{

    $pnicTab.Add ($_.) UplinkPortKey, $_. PnicDevice)

    }

    $proxy. UplinkPort |

    Select @{N = "vdSwitch"; {E = {$dvSw.Name}}.

    @{N = "$vmhost"; E = {$esx. Name}},

    @{N = "vNIC"; E = {$pnicTab [$_]} Key]}},

    @{N = "Uplink"; E={$_. Value}},

    @{N = 'Port'; E={$_. Key}}

    }

    }

    $report | Export Csv C:\dvSw-Uplink.csv - NoTypeInformation - UseCulture

  • Script for the conversion of the hyperlinks to the buttons?

    Hello!

    Does anyone know if West a script for the conversion of the hyperlinks to buttons with the action of going to the URL with the same URL, which has been used with hyperlink?

    Here it is:

    /* Copyright 2012, Kasyan Servetsky
    November 29, 2012
    Written by Kasyan Servetsky
    http://www.kasyan.ho.com.ua
    e-mail: [email protected] */
    //======================================================================================
    var scriptName = "Convert hyperlinks to buttons - 1.0";
    
    Main();
    
    //===================================== FUNCTIONS  ======================================
    function Main() {
        var hyperlink, source, sourceText, destination, page, arr, outlinedText, gb, button, behavior,
        barodeCount = 0,
        hypCount = 0;
        if (app.documents.length == 0) ErrorExit("Please open a document and try again.", true);
        var startTime = new Date();
    
        var doc = app.activeDocument;
        var layer = doc.layers.item("Buttons");
        var swatch = doc.swatches.item("RGB Yellow");
        var hyperlinks = doc.hyperlinks;
    
        var progressWin = new Window ("window", scriptName);
        progressBar = progressWin.add ("progressbar", undefined, 0, undefined);
        progressBar.preferredSize.width = 450;
        progressTxt = progressWin.add("statictext", undefined,  "Starting processing hyperlinks");
        progressTxt.preferredSize.width = 400;
        progressTxt.preferredSize.height = 30;
        progressTxt.alignment = "left";
        progressBar.maxvalue = hyperlinks.length;
        progressWin.show();
    
        for (var i = hyperlinks.length-1; i >= 0; i--) {
            hyperlink = hyperlinks[i];
            source = hyperlink.source;
            sourceText = source.sourceText;
            destination = hyperlink.destination;
            page = sourceText.parentTextFrames[0].parentPage;
    
            barodeCount++;
            progressBar.value = barodeCount;
            progressTxt.text = "Processing hyperlink " + hyperlink.name + " (Page - " + page.name + ")";
    
            arr = sourceText.createOutlines(false);
            outlinedText = arr[0];
            gb = outlinedText.geometricBounds;
            outlinedText.remove();
    
            button = page.buttons.add(layer, {geometricBounds: gb, name: hyperlink.name});
            button.fillColor = swatch;
            button.fillTint = 50;
            button.groups[0].transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;
            behavior = button.gotoURLBehaviors.add();
            behavior.url = destination.destinationURL;
    
            hyperlink.remove();
            source.remove();
    
            hypCount++;
        }
    
        var endTime = new Date();
        var duration = GetDuration(startTime, endTime);
        progressWin.close();
    
        alert("Finished. " + hypCount + " hyperlinks were convertted to buttons.\n(time elapsed: " + duration + ")", scriptName);
    
    }
    //--------------------------------------------------------------------------------------------------------------------------------------------------------
    function GetDuration(startTime, endTime) {
        var str;
        var duration = (endTime - startTime)/1000;
        duration = Math.round(duration);
        if (duration >= 60) {
            var minutes = Math.floor(duration/60);
            var seconds = duration - (minutes * 60);
            str = minutes + ((minutes != 1) ? " minutes, " :  " minute, ") + seconds + ((seconds != 1) ? " seconds" : " second");
            if (minutes >= 60) {
                var hours = Math.floor(minutes/60);
                minutes = minutes - (hours * 60);
                str = hours + ((hours != 1) ? " hours, " : " hour, ") + minutes + ((minutes != 1) ? " minutes, " :  " minute, ") + seconds + ((seconds != 1) ? " seconds" : " second");
            }
        }
        else {
            str = duration + ((duration != 1) ? " seconds" : " second");
        }
    
        return str;
    }
    //--------------------------------------------------------------------------------------------------------------------------------------------------------
    function ErrorExit(error, icon) {
        alert(error, scriptName, icon);
        exit();
    }
    
  • script for the murder of session

    Hello
    I prepare a script for the murder of session and I use the following command to generate the script for large number of users. The syntax for the murder of the session is ALTER SYSTEM KILL SESSION * "SID, SERIAL #" * IMMEDIATE. I want my output with SID, SERIAL # values within the single quots *('SID,SERIAL#') *. can someone help me on this?


    Select "ALTER SYSTEM KILL SESSION ' |" SID | «, » || SERIES # | ' IMMEDIATE '. « ; » FROM V$ SESSION WHERE BLOCKING_SESSION IS NOT NULL




    Thanks in advance

    Published by: 793097 on December 14, 2010 05:53
    select 'ALTER SYSTEM KILL SESSION '''||SID||','||SERIAL#||''' IMMEDIATE'||';' FROM V$SESSION WHERE BLOCKING_SESSION IS NOT NULL
    

    Nicolas.

  • use Image catalog script for the current document

    Is it possible to use the script to image catalogue for the current document in which we work instead of leaving the mark of script a new document fees for placed images?

    use,

    //ImageCatalog.jsx
    //An InDesign CS6 JavaScript
    /*
    @@@BUILDINFO@@@ "ImageCatalog.jsx" 3.0.0 15 December 2009
    */
    //Creates an image catalog from the graphic files in a selected folder.
    //Each file can be labeled with the file name, and the labels are placed on
    //a separate layer and formatted using a paragraph style ("label") you can
    //modify to change the appearance of the labels.
    //
    //For more information on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //Or visit the InDesign Scripting User to User forum at http://www.adobeforums.com .
    //
    //The myExtensions array contains the extensions of the graphic file types you want
    //to include in the catalog. You can remove extensions from or add extensions to this list.
    //myExtensions is a global. Mac OS users should also look at the file types in the myFileFilter function.
    main();
    function main(){
      var myFilteredFiles;
      //Make certain that user interaction (display of dialogs, etc.) is turned on.
      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
      myExtensions = [".jpg", ".jpeg", ".eps", ".ps", ".pdf", ".tif", ".tiff", ".gif", ".psd", ".ai"]
      //Display the folder browser.
      var myFolder = Folder.selectDialog("Select the folder containing the images", "");
      //Get the path to the folder containing the files you want to place.
      if(myFolder != null){
      if(File.fs == "Macintosh"){
      myFilteredFiles = myMacOSFileFilter(myFolder);
      }
      else{
      myFilteredFiles = myWinOSFileFilter(myFolder);
      }
      if(myFilteredFiles.length != 0){
      myDisplayDialog(myFilteredFiles, myFolder);
      alert("Done!");
      }
      }
    }
    //Windows version of the file filter.
    function myWinOSFileFilter(myFolder){
      var myFiles = new Array;
      var myFilteredFiles = new Array;
      for(myExtensionCounter = 0; myExtensionCounter < myExtensions.length; myExtensionCounter++){
      myExtension = myExtensions[myExtensionCounter];
            myFiles = myFolder.getFiles("*"+ myExtension);
      if(myFiles.length != 0){
      for(var myFileCounter = 0; myFileCounter < myFiles.length; myFileCounter++){
      myFilteredFiles.push(myFiles[myFileCounter]);
      }
      }
      }
      return myFilteredFiles;
    }
    function myMacOSFileFilter(myFolder){
      var myFilteredFiles = myFolder.getFiles(myFileFilter);
      return myFilteredFiles;
    }
    //Mac OS version of file filter
    //Have to provide a separate version because not all Mac OS users use file extensions
    //and/or file extensions are sometimes hidden by the Finder.
    function myFileFilter(myFile){
      var myFileType = myFile.type;
      switch (myFileType){
      case "JPEG":
      case "EPSF":
      case "PICT":
      case "TIFF":
      case "8BPS":
      case "GIFf":
      case "PDF ":
      return true;
      break;
      default:
      for(var myCounter = 0; myCounter-1){
      return true;
      break;
      }
      }
      }
      return false;
    }
    function myDisplayDialog(myFiles, myFolder){
      var myLabelWidth = 112;
      var myStyleNames = myGetParagraphStyleNames(app);
      var myLayerNames = ["Layer 1", "Labels"];
      var myDialog = app.dialogs.add({name:"Image Catalog"});
      with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Information:"});
      }
      with(borderPanels.add()){
      with(dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Source Folder:", minWidth:myLabelWidth});
      staticTexts.add({staticLabel:myFolder.path + "/" + myFolder.name});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Images:", minWidth:myLabelWidth});
      staticTexts.add({staticLabel:myFiles.length + ""});
      }
      }
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Options:"});
      }
      with(borderPanels.add()){
      with(dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Rows:", minWidth:myLabelWidth});
      var myNumberOfRowsField = integerEditboxes.add({editValue:3});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Columns:", minWidth:myLabelWidth});
      var myNumberOfColumnsField = integerEditboxes.add({editValue:3});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Horizontal Offset:", minWidth:myLabelWidth});
      var myHorizontalOffsetField = measurementEditboxes.add({editValue:12, editUnits:MeasurementUnits.points});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Vertical Offset:", minWidth:myLabelWidth});
      var myVerticalOffsetField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
      }
      with (dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Fitting:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myFitProportionalCheckbox = checkboxControls.add({staticLabel:"Proportional", checkedState:true});
      var myFitCenterContentCheckbox = checkboxControls.add({staticLabel:"Center Content", checkedState:true});
      var myFitFrameToContentCheckbox = checkboxControls.add({staticLabel:"Frame to Content", checkedState:true});
      }
      }
      with(dialogRows.add()){
      var myRemoveEmptyFramesCheckbox = checkboxControls.add({staticLabel:"Remove Empty Frames:", checkedState:true});
      }
      }
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:""});
      }
      var myLabelsGroup = enablingGroups.add({staticLabel:"Labels", checkedState:true});
      with (myLabelsGroup){
      with(dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
      }
      }
      //Text frame height
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Height:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelHeightField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
      }
      }
      //Text frame offset
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.points});
      }
      }
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      }
      }
      //Layer
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Layer:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLayerDropdown = dropdowns.add({stringList:myLayerNames, selectedIndex:0});
      }
      }
      }
      }
            var myResult = myDialog.show();
            if(myResult == true){
      var myNumberOfRows = myNumberOfRowsField.editValue;
      var myNumberOfColumns = myNumberOfColumnsField.editValue;
      var myRemoveEmptyFrames = myRemoveEmptyFramesCheckbox.checkedState;
      var myFitProportional = myFitProportionalCheckbox.checkedState;
      var myFitCenterContent = myFitCenterContentCheckbox.checkedState;
      var myFitFrameToContent = myFitFrameToContentCheckbox.checkedState;
      var myHorizontalOffset = myHorizontalOffsetField.editValue;
      var myVerticalOffset = myVerticalOffsetField.editValue;
      var myMakeLabels = myLabelsGroup.checkedState;
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = myLabelHeightField.editValue;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var myLayerName = myLayerNames[myLayerDropdown.selectedIndex];
      myDialog.destroy();
      myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName);
            }
      else{
      myDialog.destroy();
      }
      }
    }
    function myGetParagraphStyleNames(myDocument){
      var myStyleNames = new Array;
      var myAddLabelStyle = true;
      for(var myCounter = 0; myCounter < myDocument.paragraphStyles.length; myCounter++){
      myStyleNames.push(myDocument.paragraphStyles.item(myCounter).name);
      if (myDocument.paragraphStyles.item(myCounter).name == "Labels"){
      myAddLabelStyle = false;
      }
      }
      if(myAddLabelStyle == true){
      myStyleNames.push("Labels");
      }
      return myStyleNames;
    }
    function myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName){
      var myPage, myFile, myCounter, myX1, myY1, myX2, myY2, myRectangle, myLabelStyle, myLabelLayer;
      var myParagraphStyle, myError;
      var myFramesPerPage = myNumberOfRows * myNumberOfColumns;
      var myDocument = app.activeDocument;
      myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      var myDocumentPreferences = myDocument.documentPreferences;
      var myNumberOfFrames = myFiles.length;
      var myNumberOfPages = Math.round(myNumberOfFrames / myFramesPerPage);
      if ((myNumberOfPages * myFramesPerPage) < myNumberOfFrames){
      myNumberOfPages++;
      }
      //If myMakeLabels is true, then add the label style and layer if they do not already exist.
      if(myMakeLabels == true){
      try{
      myLabelLayer = myDocument.layers.item(myLayerName);
      //if the layer does not exist, trying to get the layer name will cause an error.
      myLabelLayer.name;
      }
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:myLayerName});
      }
      //If the paragraph style does not exist, create it.
      try{
      myParagraphStyle = myDocument.paragraphStyles.item(myLabelStyle);
      myParagraphStyle.name;
      }
      catch(myError){
      myDocument.paragraphStyles.add({name:myLabelStyle});
      }
      }
      myDocumentPreferences.pagesPerDocument = myNumberOfPages;
      myDocumentPreferences.facingPages = false;
      var myPage = myDocument.pages.item(0);
      var myMarginPreferences = myPage.marginPreferences;
      var myLeftMargin = myMarginPreferences.left;
      var myTopMargin = myMarginPreferences.top;
      var myRightMargin = myMarginPreferences.right;
      var myBottomMargin = myMarginPreferences.bottom;
      var myLiveWidth = (myDocumentPreferences.pageWidth - (myLeftMargin + myRightMargin)) + myHorizontalOffset
      var myLiveHeight = myDocumentPreferences.pageHeight - (myTopMargin + myBottomMargin)
      var myColumnWidth = myLiveWidth / myNumberOfColumns
      var myFrameWidth = myColumnWidth - myHorizontalOffset
      var myRowHeight = (myLiveHeight / myNumberOfRows)
      var myFrameHeight = myRowHeight - myVerticalOffset
      var myPages = myDocument.pages;
      // Construct the frames in reverse order. Don't laugh--this will
      // save us time later (when we place the graphics).
      for (myCounter = myDocument.pages.length-1; myCounter >= 0; myCounter--){
      myPage = myPages.item(myCounter);
      for (var myRowCounter = myNumberOfRows; myRowCounter >= 1; myRowCounter--){
      myY1 = myTopMargin + (myRowHeight * (myRowCounter-1));
      myY2 = myY1 + myFrameHeight;
      for (var myColumnCounter = myNumberOfColumns; myColumnCounter >= 1; myColumnCounter--){
      myX1 = myLeftMargin + (myColumnWidth * (myColumnCounter-1));
      myX2 = myX1 + myFrameWidth;
      myRectangle = myPage.rectangles.add(myDocument.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:myDocument.swatches.item("None")});
      }
      }
      }
      // Because we constructed the frames in reverse order, rectangle 1
      // is the first rectangle on page 1, so we can simply iterate through
      // the rectangles, placing a file in each one in turn. myFiles = myFolder.Files;
      for (myCounter = 0; myCounter < myNumberOfFrames; myCounter++){
      myFile = myFiles[myCounter];
      myRectangle = myDocument.rectangles.item(myCounter);
      myRectangle.place(File(myFile));
      myRectangle.label = myFile.fsName.toString();
      //Apply fitting options as specified.
      if(myFitProportional){
      myRectangle.fit(FitOptions.proportionally);
      }
      if(myFitCenterContent){
      myRectangle.fit(FitOptions.centerContent);
      }
      if(myFitFrameToContent){
      myRectangle.fit(FitOptions.frameToContent);
      }
      //Add the label, if necessary.
      if(myMakeLabels == true){
      myAddLabel(myRectangle, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myLayerName);
      }
      }
      if (myRemoveEmptyFrames == 1){
      for (var myCounter = myDocument.rectangles.length-1; myCounter >= 0;myCounter--){
      if (myDocument.rectangles.item(myCounter).contentType == ContentType.unassigned){
      myDocument.rectangles.item(myCounter).remove();
      }
      else{
      //As soon as you encounter a rectangle with content, exit the loop.
      break;
      }
      }
      }
    }
    //Function that adds the label.
    function myAddLabel(myFrame, myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myLayerName){
      var myDocument = app.documents.item(0);
      var myLabel;
      var myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      var myLabelLayer = myDocument.layers.item(myLayerName);
      var myLink =myFrame.graphics.item(0).itemLink;
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      if(myLabel.replace(/^\s*$/gi, "")==""){
      throw myError;
      }
      }
      catch(myError){
      myLabel = "No description available.";
      }
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      if(myLabel.replace(/^\s*$/gi, "")==""){
      throw myError;
      }
      }
      catch(myError){
      myLabel = "No author available.";
      }
      break;
      }
      var myX1 = myFrame.geometricBounds[1];
      var myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      var myX2 = myFrame.geometricBounds[3];
      var myY2 = myY1 + myLabelHeight;
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.parentStory.texts.item(0).appliedParagraphStyle = myLabelStyle;
    }
    
  • Adobe DC Java Script for the population of conditional field

    I have to write a script in a form that will be contained in a text box and populated by one based on the user by checking a box

    Scenario of

    A form contains two sections, there are two sections Head Office information and accounts payable.  The user saves the headquarters address information for example the street address, city, province, PC, etc.  one moves to section 2 two to record accounts payable information.  The Department accounts payable may be located to one address which is not at the headquarters.  There is a check box labeled "same as headquarters" by checking the box that the user is to identify that this is the same address and I want the form automatically fill the street address, city, province, PC already filled in the section of headquarters.  If the user does not identify the address is the same as the location of the headquarters, the user must manually register the information.

    Is not not a technical developer I'm lost, I tried many sites.  I really miss adobe lifecycle designer and the previous method to create actions.  Help, please!

    My JavaScript to date (sorry it must look not so good):

    this.getField("Same").value;

    If (Same.value! = null) {APStreetAddress.value = HOStreetAddress.value}

    This kind of thing can become a little complicated depending on exactly how you want it behaves. It's simple if you only need the script that will be triggered when the check box is selected, in which case the script of mouse upwards to the box could be:

    Script mouse upwards to the box

    (function () {}

    Do nothing if this check box cleared ix.

    If (event.target.value = 'Off') return;

    Copy the values from the previously filled (probably) the text for the other fields.

    getField("APStreeAddress").value = getField("HOStreeAddress").valueAsString;

    getField("APCity").value = getField("HOCity").valueAsString;

    getField("APPostalCode").value = getField("HOPostalCode").valueAsString;

    Add code to the other fields here

    })();

    Just be sure to use the names of real field.

  • simple script for the list of all data warehouses properties

    I searched a lot of scripts to get information about my data stores. I can quickly export most the properies of that I need right to a csv file vCenter. A flagrant lack room is the 'space Proviosoned' display of list of data store. I look at the properties of each data store to see this information. Y at - it a script that can get this information?  For this script, I don't reallt care about the news at the virtual machine level.

    Until they solve this problem, you can use something like this

    Get-Datastore | where {$_.Type -eq "VMFS"} | Select Name,
           @{N="Status";E={$_.Extensiondata.OverallStatus}},
           @{N="Device";E={$_.Extensiondata.Info.Vmfs.Extent[0].DiskName}},
           @{N="Capacity";E={"{0:f2} GB"-f ($_.CapacityMB /1KB)}},
           @{N="Free";E={"{0:f2} GB"-f ($_.FreeSpaceMB /1KB)}},
           @{N="Provisioned";E={"{0:f2} GB"-f (($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted) /1GB)}},
           @{N="Type";E={$_.Extensiondata.Info.Vmfs.Type.ToLower() + $_.Extensiondata.Info.Vmfs.MajorVersion}},
           @{N="Last Update";E={$_.Extensiondata.Info.Timestamp}}
    
  • Search for "hello world" script for the passage of form Adobe of page 1 of the form to the page-2-submit

    I want to collect the data in a simple form using multiline text and form fields in the drop-down list and sur-soumettre, display data from the form on page 2 of the PDF document as restructured text.

    I'm not trying to perform calculations or logical decisions with the form data.  That the displacement of the shape for the text displayed on the next page of the PDF file.

    I looked up and down but can't seem to find anything.

    Anyone able to point me in the right direction?

    Thank you.

    For what you are trying to do, it does not appear that the JavaScript code that gave you George is necessary. The script that he gave is rather simple with the added sapce between each item, but with the operator are simplified which each string and space at the end of the previous sValues (a type of operator, which is also in C / C++).

    However, at the point. What you want you can work to simply add a text field for each item and you want to display with the formatting you want (and), then just use a similar something like JavaScript

    getField("Text4").value = getField("Text1").valueAsString;

    to produce the field. Repeat this step for each of the fields to display. I don't know George or someone else will correct the script if I messed it up.

  • Script for the content data store

    Hello

    I'm new in the world of Vmware of scripts.

    I used powercli and real working examples of scripts to find my way.

    I am trying to create an inventory of the existing infrastructure of vmware.

    I have a list of all the VMS and their data store, but I also need a data store content.

    As:

    a list of all the stores of data in a data center.

    Download all the contents of the data store (folders, files vmdk, iso files, other files)

    A list of all the folders / files with VMservers still known in the inventory.

    The goal is to know if there are any files/VMservers on the data store, which are no longer in use and to check if we have duplicate in other data stores files

    Thanks in advance for any assistance.

    Best regards

    Dany

    Take a look at the data store provider

    Try something like

    dir vmstore: \-recurse

  • Script for the mandatory boxes

    Recently I've been editing a PDF file with checkboxes for the steps in a process. Basically, these just will be used when going through the process to check off each step individual as long as the user goes along. There was a high requirement to prevent the checkboxes of the audit until the previous one has been checked. So box 2 cannot be controlled until the box 1 have been verified, and 3 cannot be controlled until 2 is checked etc.

    Does anyone could offer some advice on a script for this? My knowledge of scripting languages is quite limited, so any help would be greatly appreciated! Thank you.

    Thanks for all the help.

    I finally managed to find a piece of code that shows the next box hidden but also hide the check box, so that from before is not checked. Here's the code I used just in case anyone is interested.

    var nHide = event.target.isBoxChecked (0)? display.visable:display.hidden;

    this.getField("Check_Box2").display = nHide;

    Once again thanks for the help.

    -James

  • PowerCLI script for the deployment of virtual machines via the model using customizations comments

    Hello... I hope someone can give me a script that will do the following:

    (1) provision VMs in vCenter template (I need 125 + VMs created in the next day or two)

    (2) use the existing customizations of comments in vCenter

    (3) let me enter data warehouses available to be created on the virtual machines.  Example: I want that VMs on warehouses of specific data as LUN2, LUN5, LUN6, LUN12, LUN1, etc...  However, the script must have the ability to know when a data store is near the threshold of capacity, say 90%, so it can use one of the other warehouses available, identified in the script... similar to storage profiles.  We still have to adopt profiles storage but plan to do so once upgraded us to v5.1 in the next month or two.  We hope that this will help us keep our replicated LUN more organized during the use of SRM and copy to remote groups, our team of storage's configuration on 3PAR.


    Additional information: I will use 2 styles... Windows XP and Win7.  Their respective sizes are 40 and 60 GB due to all applications for stable DR.  Data warehouses are ea 500 GB.

    Please let me know if additional information is necessary... Thank you!!!

    Charles

    No, unfortunately you cannot specify a folder like this.

    You'll have to do a

    $folder = get-file-name WinXP

    New-VM-$folder file...

    Remove the line of New - VM WhatIf switch if you really want to start creating virtual machines.

  • Record WLST scripts for the card settings

    Hello

    I'm new to the WLST Script recording tool.

    I am trying to save my settings for JmsAdapter create a new Pool of outbound connections, but the registration tool does not seem to be able to capture changes in the settings of the map file is empty after the changes have been made.

    Anyone know why this is?

    Is there a way make the folder working tool for the card settings?

    If this is not the case, if anyone knows the necessary functions/directories in a WLST to create outbound connections Pools in the JMSAdapter settings?

    Any help will be very appreciated!

    Thank you

    Al

    JMS adapter uses the deployment plan where wlst can't save this.

    The recording feature intercepts calls JMX and translated into corresponding WLST scripts, as well as features that use deployment plans fall outside the coverage area of the "Record" feature.

    Best regards

    Vivek Vishal

  • FDM as Script for the account mapping

    I use the following script as a 'Like' card for the account. The import file has account in this format: 123456-Description. I would like to delete everything after the "-" and set the result to just the account number; However, I get an error saying card conditional Script error: expected "End" to line (4)

    sParse ="-"
    IPOS = InStr (varValues (13), sParse)
    If iPos = 0 Then Result = varValues (13)
    Else Result = Left (varValues (13), iPos-1)
    End If

    Someone knows how to fix the error? I tried to move the End If up to line 4, but that did not help.

    Thank you.

    Terri T.

    The RESULT setting should be on its own line of the if statement as follows:

    sParse="-"
    ipos=InStr(varValues(13),sParse)
    If iPos=0 Then
         RESULT=varValues(13)
    Else
         RESULT=Left(varValues(13),iPos-1)
    End If
    
  • How to create a script for the name of the channel to take and insert text on profile in CS5

    I am a silkscreen and I print my Photoshop starts. I regularly work with multi channel files or RGB files with additional color channels. I created actions to place check marks, resize images, etc. to be ready to print manually but I create for each display text labels, if they are absent from the original work.


    The files I work with have named pipes as "basic white, red, green, blue 284" etc. which indicates the color of the ink. I want to be able to do is create a script that copies the text of the channel name and insert it into a separate or each/all channels to the top of the file, so that when I print every positive there is a label corresponding to the color of the ink.


    I don't know if this is even possible, and I am limited in my knowledge when it comes stock and no experience with scripting and have had pretty good luck in the past for actions to do what I want without unnecessary steps.


    On my target action registration, it creates a new channel with each individual reg mark then combined in a separate channel in which I just copy the contents and select all channels of ink and fill with black to make them appear, I am happy with the steps that must be that it is not too complicated and if it could do the same with labels I would be happy with that.


    Thanks in advance!

    Something like that?

    // the color used for the text
    var black = new SolidColor();
    black.rgb.hexValue = '000000';
    // set this to space the labels
    var horizontalOffest = new UnitValue(20,'pt');
    var doc = app.activeDocument;
    var currentLayer = doc.activeLayer;
    var textLayer = doc.artLayers.add();
    textLayer.kind = LayerKind.TEXT;
    // font requires the postscript name of the font
    textLayer.font = "ArialMT";
    textLayer.textItem.size = new UnitValue(9,'pt');
    textLayer.textItem.justification = Justification.RIGHT;
    // set the position for the text. this sets to top right corner of the channel
    // here it is set so the text baseline ends  40pts from the right edge, 15pts down
    textLayer.textItem.position = [new UnitValue(doc.width.as('pt')-50,'pt'),new UnitValue(15,'pt')];
    textLayer.textItem.contents = 'label';// temp label string
    
    for(var channelIndex = 0; channelIndex		   
  • Need a script for the trails and clipping paths

    I have over a hundred images (.tif or.) TIF) which have cut a path, but the names are all different. In addition, some have been activated for clipping paths. I need all paths tracks/clipping named path 1. I found an old javascript to do this using ExtendScript Toolkit, but it does not work. Any advice would be greatly appreciated.

    var selFolder = Folder.selectDialog ("location of pictures to treat... ») ;

    var files = selFolder.getFiles (/.) TIF | TIF / I) ;// must change to different formats

    argument newPathName var = prompt ("Put your cutting path name that you want," "path 1,"Clipping name"")

    for (var f = 0; f < files.length; f ++)

    {

    var doc = app.open (files [f]);

    var numberOfPaths = doc.pathItems.length;

    for (variety p = 0; p < numberOfPaths; p ++)

    {

    If (doc.pathItems [p] .kind == PathKind.CLIPPINGPATH & & argument newPathName! = doc.pathItems [p] .name) doc.pathItems [p] .name = argument newPathName;

    }

    doc. Close (SaveOptions.SAVECHANGES);

    }

    It is not a translation problem, after all, some of the files had problems sharing & permissions so I changed them all to & read/write. So I ran two separate scripts because I do not know how to combine them into one. It's what worked:

    This is script is for the NORMALPATH railways:

    var selFolder = Folder.selectDialog ("location of pictures to treat... ») ;

    var files = selFolder.getFiles (/ \.tif$/i) ;// must change to different formats

    argument newPathName var = prompt ("Put your cutting path name you want", "path 1", "Path name")

    for (var f = 0; f)< files.length;="" f++="">

    {

    var doc = app.open (files [f]);

    var numberOfPaths = doc.pathItems.length;

    for (variety p = 0; p)< numberofpaths;="" p++="">

    {

    If (doc.pathItems [p] .kind == PathKind.NORMALPATH & argument newPathName! = doc.pathItems [p] .name) doc.pathItems [p] .name = argument newPathName;

    }

    doc. Close (SaveOptions.SAVECHANGES);

    }

    This is for the CLIPPINGPATH railways:

    var selFolder = Folder.selectDialog ("location of pictures to treat... ») ;

    var files = selFolder.getFiles (/ \.tif$/i) ;// must change to different formats

    argument newPathName var = prompt ("Put your cutting path name that you want," "path 1,"Clipping name"")

    for (var f = 0; f)< files.length;="" f++="">

    {

    var doc = app.open (files [f]);

    var numberOfPaths = doc.pathItems.length;

    for (variety p = 0; p)< numberofpaths;="" p++="">

    {

    If (doc.pathItems [p] .kind == PathKind.CLIPPINGPATH & argument newPathName! = doc.pathItems [p] .name) doc.pathItems [p] .name = argument newPathName;

    }

    doc. Close (SaveOptions.SAVECHANGES);

    }

    I didn't have a single file with two paths inside and a dialogue has come, and I changed it to track 2, no sweat.

    Thanks for all your help!

Maybe you are looking for