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();
}

Tags: InDesign

Similar Questions

  • 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

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

  • Keyboard shortcuts for the buttons works irregularly - why?

    When you use the access key for the button attributes, they work sometimes and not others. Three behaviors are observed:

    -use the accesskey times moves the focus and click on the button (correct behavior)

    -use the access key moves the focus only - do not by clicking on the button

    -use the accesskey does nothing

    These problems occur without change installation, restart, etc..

    What could cause this?

    Moreover, 3.6.28 works very well with the exact same web application.

    It might be useful to have a small script for conducting a census of the keyboard shortcuts page. You can open the web console (Ctrl + Shift + k), paste the following options next to the circumflex accent ("' >" ") and press ENTER. A new element is added at the end of the body with the results.

    var aks=document.querySelectorAll("a[accesskey], button[accesskey], input[accesskey]"); var out=document.createElement("pre"); for(var i=0; i<aks.length; i++) out.appendChild(document.createTextNode("Tag:'"+aks[i].nodeName+"'; id:'"+aks[i].id+"'; name:'"+aks[i].name+"'; key:'"+aks[i].getAttribute("accesskey")+"'\n")); document.body.appendChild(out);
    
  • ToolTip for the button

    Nice day

    I'm new to the blackberry development. I created a bitmapbuttonfield using the examples of the advanced user interface. There is a button with an image. I want to display a ToolTip for the button when the button receives the focus. Can someone please help

    Thanks in advance

    Hello

    Use this code:

    package mypackage;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    
    public final class MyScreen extends TooltipScreen
    {
    
        ButtonField btn1,btn2,btn3;
        public MyScreen() {
    
            btn1=new ButtonField();
            btn1.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                    Dialog.alert("Button 1 Click");
                }
            });
            btn2=new ButtonField();
            btn2.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                    Dialog.alert("Button 2 Click");
                }
            });
    
            btn3=new ButtonField();
            btn3.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                    Dialog.alert("Button 3 Click");
                }
            });
            add(btn1, "Button 1");
            add(btn2, "Button 2");
            add(btn3, "Button 3");
    
        }
    
    }
    
    package mypackage;
    
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.Vector;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.XYRect;
    import net.rim.device.api.ui.container.MainScreen;
    
    public class TooltipScreen extends MainScreen {
    
        TooltipScreen screen = this;
        boolean doRedraw = false;//prevent infinte redrawing
        Vector tooltips = new Vector();//vector to hold tooltip strings
        private Timer tooltipTimer = new Timer();
        private TimerTask tooltipTask;
        boolean alive = false;//is the tooltip alive? used to pop it after our timeout
        int count = 0;//used to calculate time tooltip is displayed
        //tooltip popup colours:
        int backgroundColour = 0xeeeeee;
        int borderColour = 0xaaaaaa;
        int fontColour = 0x666666;
        //the tooltip:
        String tooltip;
        int tooltipWidth;
        int yCoord;
        int xCoord;
        //region parameters:
        XYRect contentArea;
        int contentBottom;
        int contentRight;
    
        public TooltipScreen() {
            super();
    
            //when timeout reaches 100ms*20 ie. 2seconds set alive to false and redraw screen:
            tooltipTask = new TimerTask() {
    
                public void run() {
                    if (alive) {
                        count++;
                        if (count == 20) {
                            alive = false;
                            invalidate();
                        }
                    }
                }
            };
    
            tooltipTimer.scheduleAtFixedRate(tooltipTask, 100, 100);
    
        }
    
        //override add method adds an empty string to tooltip vector:
        public void add(Field field) {
            tooltips.addElement("");
            super.add(field);
        }
    
        //custom add method for fields with tooltip: add(myField, "myTooltip");
        public void add(Field field, String tooltip) {
            super.add(field);
            tooltips.addElement(tooltip);
        }
    
        public void setColours(int backgroundColour, int borderColour, int fontColour) {
            this.backgroundColour = backgroundColour;
            this.borderColour = borderColour;
            this.fontColour = fontColour;
        }
    
        //reset everything when user changes focus,
        //possibly needs logic to check field has actually changed (for listfields, objectchoicefields etc etc)
        protected boolean navigationMovement(int dx, int dy, int status, int time) {
            count = 0;
            alive = true;
            doRedraw = true;
            return super.navigationMovement(dx, dy, status, time);
        }
    
        protected void paint(Graphics graphics) {
            super.paint(graphics);
            if (alive) {
                Field focusField = getFieldWithFocus();
                tooltip = (String) tooltips.elementAt(screen.getFieldWithFocusIndex());
    
                //don't do anything outside the norm unless this field has a tooltip:
                if (!tooltip.equals("")) {
                    //get the field content region, this may fall inside the field actual region/coordinates:
                    contentArea = focusField.getContentRect();
                    contentBottom = contentArea.y + contentArea.height;
                    contentRight = contentArea.x + contentArea.width;
    
                    //+4 to accomodate 2 pixel padding on either side:
                    tooltipWidth = graphics.getFont().getAdvance(tooltip) + 4;
    
                    yCoord = contentBottom - focusField.getManager().getVerticalScroll();
                    //check the tooltip is being drawn fully inside the screen height:
                    if (yCoord > (getHeight() - 30)) {
                        yCoord = getHeight() - 30;
                    }
    
                    //check the tooltip doesn't get drawn off the right side of the screen:
                    if (contentRight + tooltipWidth < getWidth()) {
                        xCoord = contentRight;
                    } else {
                        xCoord = getWidth() - tooltipWidth;
                    }
    
                    //draw the tooltip
                    graphics.setColor(backgroundColour);
                    graphics.fillRect(xCoord, yCoord, tooltipWidth, 30);
                    graphics.setColor(borderColour);
                    graphics.drawRect(xCoord, yCoord, tooltipWidth, 30);
                    graphics.setColor(fontColour);
                    graphics.drawText(tooltip, xCoord + 2, yCoord);
                }
            }
            //doRedraw logic prevents infinite loop
            if (doRedraw) {
                //System.out.println("redrawing screen: " + System.currentTimeMillis());
                screen.invalidate();
                doRedraw = false;
            }
        }
    }
    
    package mypackage;
    
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.PopupScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    class MyTooltip extends PopupScreen{
        int _x;
        int _y;
        TooltipThread _tooltipThread;
    
        private MyTooltip(Manager manager) {
            super(manager);
         }
        public void sublayout(int width, int height)    {
            super.sublayout(width,height);
            setPosition(_x,_y);
            System.out.println("Tooltip x: " + Integer.toString(_x) + ", y: " + Integer.toString(_y));
        }
        protected void applyTheme() {
            // Overriden to suppress Border etc.
        }
        public void removeToolTip() {
            if ( _tooltipThread != null ) {
                _tooltipThread.dismiss();
            }
        }
        private void display(UiApplication uiApp, int x, int y, int displayTime) {
            _x = x;
            _y = y;
            _tooltipThread = new TooltipThread(uiApp, this, displayTime);
            _tooltipThread.start();
        }
    
        public static MyTooltip addToolTip(UiApplication uiApp, String toolTipString, int x, int y, int displayTime) {
            VerticalFieldManager manager = new VerticalFieldManager(Manager.FIELD_VCENTER|Manager.NON_FOCUSABLE) {
                protected void paint(Graphics graphics) {
                    graphics.setColor(0x00FFFFFF); // White
                    graphics.fillRect(0,0,getWidth(),getHeight());
                    graphics.setColor(0x00000000); // Black
                    graphics.drawRect(0,0,getWidth(),getHeight());
                    super.paint(graphics);
                }
            };
            MyTooltip toolTip = new MyTooltip(manager);
            LabelField label = new LabelField(' ' + toolTipString + ' ', LabelField.NON_FOCUSABLE);
            label.setFont(Font.getDefault().derive(Font.PLAIN, 16));
            toolTip.add(label);
            toolTip.display(uiApp, x, y, displayTime);
            return toolTip;
        }
    
        class TooltipThread extends Thread {
    
            Object _notifyObject = new Object(); // Used to allow user to dismiss this Tooltip
            PopupScreen _tooltip; // Screen we are going to display
            UiApplication _ourApplication; // access to pushGlobalScreen and dismissStatus from our Application
            int _displayTime; // in seconds
    
            public TooltipThread(UiApplication ourApplication, PopupScreen tooltip, int displayTime) {
                _tooltip = tooltip;
                _ourApplication = ourApplication;
                _displayTime = displayTime;
            }
    
            public void run() {
                _ourApplication.pushGlobalScreen(_tooltip, 999, false);
                synchronized(_notifyObject) {
                    try {
                        _notifyObject.wait(_displayTime * 1000);
                    } catch (Exception e) {
                    }
                };
                _ourApplication.dismissStatus(_tooltip);
            }
    
            public void dismiss() {
                // notify the waiting object to stop the Thread waiting
                synchronized(_notifyObject) {
                    _notifyObject.notify();
                }
            }
    
        }
    
    }
    
  • Need help for the button to trigger on the text caption effect

    Hello world

    I work in

    Screen Shot 2016-04-13 at 12.52.31 PM.png

    on a Mac (chart below)

    Screen Shot 2016-04-13 at 12.53.04 PM.png

    I'm very new to Captivate (only my second week), but am familiar in other Adobe programs. I'm trying to get a dynamic object that I made in a button to trigger an effect on a text caption. I scrolled the forums here and tried various things of the advanced actions for just using the drop down menus in the property inspector and nothing that I tried gives me the result I want.

    Here is a screenshot of what I'm working with.

    Screen Shot 2016-04-13 at 12.54.37 PM.png

    What I want to do is for the arrows for the buttons (and they are currently). When the slide appears first I don't want that image and the arrows visible. So when the user clicks on the arrow, I want the effect I chose (spiral) that will be triggered with the corresponding text.

    Looks like my property for each caption Inspector (the names are different for each)

    Screen Shot 2016-04-13 at 12.58.03 PM.png

    And I also tried to write a few advanced Actions that follow as well as tutorials that I found online, and nothing gives me what I want.

    When I preview the slide I can see everything on entry and then when I click the button to apply the effect. I rechecked the advanced actions and usually when I try these nothing happens at all.

    Is - it there anyway that I can get that works this way, I'm wanting. It seems that it should be simple and I'm right on it.

    The shape of buttons are all pause at this moment, it's OK.

    I just tried it out and see what you mean. The text is there from the beginning, and that shouldn't be the case. you expect it not to appear when the button is clicked. I have never used this spiral effect myself, but since you have no control over it, I mean you can't see where starts the effect at all, there is no visible path you have with the other effects of the entry. Either, you need to create a custom, effect whose path begins with text outside the scene, or a combination of an Alpha to + a standard entrance effect.

    Tried the first one with a simple left to a straight path. I edited the paths so that they all start at the same position horizontal and end at the same horizontal position. So happy with the leaders and Guides that we finally got in Captivate, they are very useful for this type of design:

    It's the chronology:

  • After update to the last version of the space bar no longer give me hand tool / to navigate around my image, everyone knows this? Even for the button on my wacom pen...

    After update to the last version of the space bar no longer give me hand tool / to navigate around my image, everyone knows this? Even for the button on my wacom pen...

    ... computer update restarted... everything seems to work again.

  • When using the 'tools', 'Interactive objects', 'Add a button', how to make the text for the button name is displayed? I have tried everything and only the background, or lacxk, appears.

    I created a pdf document using Adobe Acrobat XI base and want to put a link on each page, return to the table of contents. However, the tool "Add a link" I cannot place this link on each page at a time. Accordingly, I used the tool 'Add a button' interactive Actions that allows me to do what I want. However, when I enter the name of the button, add background color (or not) and register, the name of the text for the button does not show, only the background appears (or nothing if I select no background). The button works, it just is not labeled. Any help will be appreciated.

    This is the area of the label, under Properties - Options.

    The game, 23:02, charlesc90551452, [email protected] , 14 may 2015

  • ToolTip for the button previous and next in trainButtonBar

    I'm not able to view the ToolTip for the buttons next and previous by using trainButtonBar. Can someone help me on this?

    Published by: 952401 on August 13, 2012 05:50

    Hey Vinay... I think you can try this
    Required fields in a train

    It was exactly the solution you need.

    Thank you
    Serge

  • 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;
    }
    
  • I need a custom script for the calculation in a PDF form.

    I am working on a form of commissions airport rental cars with exclusions.  Could someone please a custom for the following script?

    R + C = less the sum of (Ea, Eb, Ec)

    Thank you!

    Under the Simple field of tab notation option calculate enter:

    R + C - (Ea + Eb + Ec)

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

  • 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

  • Need a script for the network card and Vswitch info

    Hello


    Can we have a script to list out the output of information network/vsiwtch as below for all clusters in VC to CSV

    . Name of host mcadress name of the physical card Vswitch name team Vswitch (NLB/FTL)

    Hello

    Sorry for the late reply, was absent for a few days

    It's the new version:

    $output = foreach ($esxi Get-cluster |) Get-VMHost | Name sort)

    {

    foreach ($vSS in (Get-VirtualSwitch - VMHost $esxi))

    {

    $pnic = $vSS.ExtensionData.Pnic - replace ".". *- » | Kind of Teddy bear

    $mac_address = foreach ($p in $pnic) {$esxi.ExtensionData.Config.Network.Pnic |} Where-Object {$_.} Device-match $p} | %{$_. Mac}}

    $esxi | Select-Object @{N = 'ESXi'; E={$_. Name}}, @{N = "Physical map"; {E = {[String]: Join (",", ($PNIC))}}, @{N = "MAC address"; {E = {[String]: Join (",", ($Mac_Address))}}, @{N = 'vSwitch name'; {E = {$vSS.Name}}, @{N = "vSwitch political grouping"; {E = {$vSS.ExtensionData.spec.Policy.NicTeaming.Policy}}

    }

    }

    $output | Export-CSV "C:\output.csv".

    Example of output:

    ESXi: test

    Physical map: vmnic0, vmnic1

    MAC address: 11:22:33:44:55:66, 11:22:33:44:55:67

    vSwitch name: vSwitch0

    vSwitch political group: loadbalance_srcid

    ESXi: test1

    Physical map: vmnic2, vmnic3

    MAC address: 11:22:33:44:55:68, 11:22:33:44:55:69

    vSwitch name: vSwitch1

    vSwitch political group: loadbalance_srcid

    Hope this helps,

    Steven.

Maybe you are looking for

  • How can I get rid of wedownloadmanager

    I get this all the time and it is driving me crazy. How can I get rid of him

  • P1C61EA #ABZ: problem Audio (driver?)

    Hi, yesterday I updated to W10 anniversary. After that, my PC has a lot of audio problems, include the bass too metallic. So after reading in this forum I've updated the driver (sp74867), but doesn't my audio control (F6 key on the keyboard) and the

  • Change the format to png to PDF screenshot

    Then capture a screenshot, I have changed the default file to png to PDF format and have forgotten how I did it. I wanted to show a friend how to do this, but remember how it's done. There, nobody how to change the default format? Thank you very much

  • Windows search indexing, but number of indexed items changes do not

    Hello I'm using XPSP3 and Search 4.0.  Windows search indexing, but the number of indexed items changes do not.  It has been like that for several hours.  What is happening with this?  It slows down the performance, but I don't want to stop so he'll

  • Printer lazer 1517

    My printer does not print landscape on paper 8 by 14 in the format.  It prints the first two columns in my spreadsheet and draws the rest of the columns on a sheet separated.  A serviceable man seems not to be able to solve the problem.  I have anoth