Need a Script to the space of images on a total gap, then tag each image with the percentage of the total image space

By editing the other scripts, I found here and other sites (including the labels size rorohiko), I worked on a script that will each image with the dimensions of the label and calculate the percentage of the spread of everything (including the text, white space).

Now, I was invited to a script that tagged the images with the percentage of total image on a gap space. This script is so space images on a total gap, then tag each image with the percentage of the total image space. For example if there is an image that is 10 x 10 inches and four pictures that are images of 2.5x2.5, 10 x 10 would be tagged with 50% and the 2.5x2.5 would be tagged with 12.5%.

This is the script that does the percentage of total circulation. Can some clever person get to do what I need?

Suze

(Sorry, I don't know how to post the script here with line numbers!)

//

This script adds printing of information labels to each graphic image. The labels are on a separate layer

named "PercentageLabels" so that all these added labels can be removed again by simply removing

the layer.

//

If you move or resize items, simply re-run the script to update the labels.

//

Before (re) start the script, you can define a paragraph style "SizeLabelStyle".

This style will apply to all content on labels.

//

Before (re) start the script, you can set a style of object 'SizeLabelObjectStyle '.

This style of object apply to all executives of the label - so if you want a specific background

fill out or frame, do it through this object style.

//

You can change the units of the size label. I put in inches. Change the line below that has

kUnitToUse - you can use:

MeasurementUnits.CENTIMETERS

MeasurementUnits.CICERO

MeasurementUnits.INCHES

MeasurementUnits.MILLIMETERS

MeasurementUnits.PICAS

MeasurementUnits.PIXELS

MeasurementUnits.POINTS

//

By default the script will not attempt to label the "nested" images If you also want to label

nested images (for example inline images, anchored frames, pasted images in the images,...) to change the line

below to read:

kLabelNestedItems = 1

//

If you want a specific image to stay without a label, you can use the Script label palette for

assign a script called 'ignore' for this frame. The script will then not label this framework to the

the title of the script is removed again.

//

Change the lines with kDontLabelImageFrames, kDontLabelTextFrames, kDontLabelOtherFrames

below if you want to restrict labelling to only certain types of images: replace the '0'

in "1" to enable these options.

//

Change the line with kShowImageFileName if you also want to display the names of the image in the

size for the picture frames.

//

Small frames are not labelled - the cutoff point is currently a less than 0.1 inch high framework

or 0.1 inch wide. You can change the cutoff point by adjusting the lines with kDontLabelBelowWidth

or kDontLabelBelowHeight below.

//

var Girard;

var gScriptFile;

var gCaches;

// ****************

That's cheating spread automatically calculated

var doc = app.activeDocument;

doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;

doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;

PageWidth = doc.documentPreferences.pageWidth var;

stucture var pagewidth = * 2;

var spreadheight = doc.documentPreferences.pageHeight;

var spreadsquinch = stucture * spreadheight;

Alert ("the total measure of square inch of spread is:" + spreadsquinch);

//******************

VR;

{

If (app.activeScript instanceof file)

{

var gScriptFile = app.activeScript;

}

}

catch (Girard)

{

}

If (typeof (kLogLevel) is "undefined")

{

const kLogLevel = 5;

const kMaxLogNestLevel = 5;

const kLogToMessageBox = 0;

const kLogToConsole = 0;

const kLogToFile = 0;

const kLogFileName = "PercentageLabels.log";

const kIgnoreFrameLabel = "ignore."

const kSizeLabelLayerName = "PercentageLabels";

const kLabelNestedItems = 0;

const kDontLabelImageFrames = 0;

const kDontLabelTextFrames = 1;

const kDontLabelOtherFrames = 0;

const kUnitToUse = MeasurementUnits.INCHES;

const kShowImageFileName = 0; This set to 1 to precede the name of the image file in the tag

Below all of the measures are expressed in kUnitToUse (e.g. inches if MeasurementUnits.INCHES is used)

const kRoundToDecimals = 2;

The separator to use between objects - for example MyImage.jpg - 7.22 x 9,34

const kSeparatorBetweenNameAndSize = "-";

const kSeparatorBetweenHeightAndWidth = "H x"; "

const kSeparatorAfterWidth = "W";

const kDontLabelBelowWidth = 0.1; In kUnitToUse

const kDontLabelBelowHeight = 0.1; In kUnitToUse

const kLabelStyleName = "SizeLabelStyle";

const kLabelObjectStyleName = "SizeLabelObjectStyle";

const kLabelHeight = 0.6; In kUnitToUse

const kLabelWidth = 2.5; Expressed in kUnitToUse (e.g., inches).

}

var gRunState =

{

logToMessageBox: kLogToMessageBox,

logToConsole: kLogToConsole,.

logToFile: kLogToFile,.

functionNestLevel: 0,

logFunctionEntry: true,

logFunctionExit: true,

logLevel: kLogLevel,.

logFileName: kLogFileName

};

Main();

// ****************

function ConvertToFrame (thePageItem)

{

/ * / / / LogEntry ("ConvertToFrame");

var retVal = thePageItem.getElements () [0];

/ * / / / LogExit ("ConvertToFrame");

Return retVal;

}

// ****************

function CollectionToArray (theCollection)

{

/ * / / / LogEntry ("CollectionToArray");

var retVal = theCollection.everyItem () .getElements () .slice (0);

/ * / / / LogExit ("CollectionToArray");

Return retVal;

}

// ****************

function GetImageFile (pageItem)

{

/ * / / / LogEntry ("GetImageFile");

var imageFile = null;

do

{

Try

{

pageItem = ConvertToFrame (pageItem);

If (!) (("allGraphics" in pageItem))

{

break;

}

var allGraphics = pageItem.allGraphics.slice (0);

If (allGraphics.length == 0)

{

break;

}

var chart = allGraphics [0];

var graphic.itemLink = link;

imageFile = new File (link.filePath);

}

catch (Girard)

{

}

}

While (false);

/ * / / / LogExit ("GetImageFile");

return imageFile.

}

// ****************

function GetImageName (pageItem)

{

/ * / / / LogEntry ("GetImageName");

var imageName = "";

do

{

var imageFile = GetImageFile (pageItem);

If (imageFile is nothing)

{

break;

}

imageName = imageFile.displayName;

}

While (false);

/ * / / / LogExit ("GetImageName");

return imageName;

}

// ****************

function GetOuterPageItem (pageItem)

{

/ * / / / LogEntry ("GetOuterPageItem");

var retVal = null;

do

{

Try

{

retVal = pageItem.parent;

If (retVal instanceof spread | retVal instanceof Page)

{

retVal = pageItem;

break;

}

If (retVal instanceof character)

{

retVal = GetOuterPageItem(retVal.parentTextFrames[0]);

break;

}

}

catch (Girard)

{

retVal = null;

}

}

While (false);

/ * / / / LogExit ("GetOuterPageItem");

Return retVal;

}

// ****************

function LogMessage (message, collapseLines)

{

If (gRunState.logToConsole)

{

$.writeln (message);

}

If (gRunState.logToFile)

{

var logFile = new file (gScriptFile.parent + "/" + gRunState.logFileName);

var now = new Date();

logFile.open ("a");

logFile.write (now.toString () + ":"+ message + "\n" ');

logFile.close ();

}

If (gRunState.logToMessageBox)

{

Alert (message);

}

}

// ****************

LogEntry (message) function

{

If (gRunState.logFunctionEntry)

{

If (gRunState.functionNestLevel < kMaxLogNestLevel) {}

for (var idx = 0; idx < gRunState.functionNestLevel; idx ++)

{

message = "" + message;

}

Filled (message + "<", true);

}

}

gRunState.functionNestLevel ++;

}

// ****************

function LogError (message)

{

If (gRunState.logLevel > = 1).

{

LogMessage ("* ERROR *:" + message, false);

}

}

// ****************

function LogExit (message)

{

-gRunState.functionNestLevel;

If (gRunState.functionNestLevel < 0)

{

LogError ("LogExit: unbalanced nesting of function");

}

If (gRunState.logFunctionExit)

{

If (gRunState.functionNestLevel < kMaxLogNestLevel) {}

for (var idx = 0; idx < gRunState.functionNestLevel; idx ++)

{

message = "" + message;

}

Filled (message + ">", true);

}

}

}

// ****************

function LogNote (message)

{

If (gRunState.logLevel > = 3)

{

LogMessage ("Note:" + message, false);

}

}

// ****************

function LogWarning (message)

{

If (gRunState.logLevel > = 2)

{

LogMessage ("WARNING:" + message, false);

}

}

// ****************

function Main()

{

/ * / / / LogEntry ("Main");

var savedUserInteractionLevel = app.scriptPreferences.userInteractionLevel;

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

do

{

Try

{

activeDocument var = app.activeDocument;

If (!.) (activeDocument instanceof Document))

{

LogError ("hand: activeDocument isn't a Document");

break;

}

var savedHorizontalMeasurementUnits = activeDocument.viewPreferences.horizontalMeasurementUnits;

activeDocument.viewPreferences.horizontalMeasurementUnits = kUnitToUse;

var savedVerticalMeasurementUnits = activeDocument.viewPreferences.verticalMeasurementUnits;

activeDocument.viewPreferences.verticalMeasurementUnits = kUnitToUse;

var savedRulerOrigin = activeDocument.viewPreferences.rulerOrigin;

activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

do

{

Try

{

ProcessFrames (activeDocument);

}

catch (Girard)

{

Alert ("the script encountered a situation that we don't know how to handle. "He received the error, says '" + Parker + "' in Main()"); "."

}

}

While (false);

activeDocument.viewPreferences.rulerOrigin = savedRulerOrigin;

activeDocument.viewPreferences.horizontalMeasurementUnits = savedHorizontalMeasurementUnits;

activeDocument.viewPreferences.verticalMeasurementUnits = savedVerticalMeasurementUnits;

}

catch (Girard)

{

Alert ("the script encountered a situation that we don't know how to handle. "He received the error, says '" + Parker + "' in Main()"); "."

LogError ("Hand throw" + Girard);

}

}

While (false);

app.scriptPreferences.userInteractionLevel = savedUserInteractionLevel;

/ * / / / LogExit ("Main");

}

// ****************

function ProcessFrames (doc)

{

/ * / / / LogEntry ("ProcessFrames");

var err;

do

{

If (!.) (doc instanceof Document))

{

LogError ("ProcessFrames: doc should be a Document");

break;

}

Try

{

var existingLayer = doc.layers.itemByName (kSizeLabelLayerName);

existingLayer.id;

existingLayer.remove ();

}

catch (err)

{

}

If (kLabelNestedItems)

{

var pageItems = doc.allPageItems.slice (0);

}

on the other

{

var pageItems = CollectionToArray (doc.pageItems);

}

var frameReferences = [];

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

{

do

{

var pageItem = pageItems [pageItemIdx];

If (pageItem.itemLayer.name is kSizeLabelLayerName)

{

break;

}

var pageItem = ConvertToFrame (pageItem);

If (instanceof TextFrame pageItem)

{

If (kDontLabelTextFrames)

{

break;

}

}

ElseIf (pageItem graphic instanceof)

{

If (kDontLabelImageFrames)

{

break;

}

}

on the other

{

If (kDontLabelOtherFrames)

{

break;

}

}

If (pageItem.label.toLowerCase () is kIgnoreFrameLabel)

{

break;

}

var width = pageItem.geometricBounds [3] - pageItem.geometricBounds [1];

var height = pageItem.geometricBounds [2] - pageItem.geometricBounds [0];

If (width < kDontLabelBelowWidth)

{

break;

}

If (height, kDontLabelBelowHeight)

{

break;

}

frameReferences.push (pageItem);

}

While (false);

}

var sizeLabelLayer = doc.layers.add ({name: kSizeLabelLayerName});

for (var pageItemIdx = 0; pageItemIdx < frameReferences.length; pageItemIdx ++)

{

Try

{

var pageItem = frameReferences [pageItemIdx];

var width = pageItem.geometricBounds [3] - pageItem.geometricBounds [1];

var height = pageItem.geometricBounds [2] - pageItem.geometricBounds [0];

var labelItem = doc.textFrames.add (null, LocationOptions.BEFORE, GetOuterPageItem (pageItem));

labelItem.itemLayer = sizeLabelLayer;

var boxsquinch = width * height

var boxpercent = (boxsquinch / spreadsquinch) * 100

var roundpercent = Math.round (boxpercent)

var labelText = "";

If (kShowImageFileName)

{

var imageName = GetImageName (pageItem);

If (imageName! = "")

{

labelText += imageName + kSeparatorBetweenNameAndSize;

}

}

labelText += RoundString (height, kRoundToDecimals) + kSeparatorBetweenHeightAndWidth + RoundString(width, kRoundToDecimals) + kSeparatorAfterWidth + ' \r\n'+ roundpercent + '% ';

labelItem.contents = labelText;

xPos = pageItem.geometricBounds var [1];

yPos = pageItem.geometricBounds var [0] + kLabelHeight;

labelItem.geometricBounds is [Posy, xPos, yPos + kLabelHeight, xPos + kLabelWidth];.

Try

{

labelItem.parentStory.characters.everyItem () .appliedCharacterStyle = doc.characterStyles.item (0);

}

catch (err)

{

}

Try

{

labelItem.parentStory.paragraphs.everyItem () .appliedParagraphStyle = kLabelStyleName;

}

catch (err)

{

}

Try

{

labelItem.appliedObjectStyle = doc.objectStyles.itemByName (kLabelObjectStyleName);

}

catch (err)

{

}

}

catch (err)

{

}

}

}

While (false);

/ * / / / LogExit ("ProcessFrames");

}

// ****************

function RoundString (numVal, decimal)

{

/ * / / / LogEntry ("Round");

var retVal = Math.round (numVal * Math.pow(10,decimals)) + "";

retVal = retVal.substring(0,retVal.length-decimals) + "." + retVal.substring(retVal.length-decimals);

/ * / / / LogExit ("Round");

Return retVal;

}

What do you mean?

var myDoc = app.activeDocument;
var mySpreads = myDoc.spreads;
var myRectangles = myDoc.rectangles;
var myImages = 0;
for (var i = 0; i < mySpreads.length; i++) {
    var mySpreadWidth = 0;
    var mySpreadHeight = myDoc.documentPreferences.pageHeight;
    for (var j = 0; j < mySpreads[i].pages.length; j++) {
        mySpreadWidth += myDoc.documentPreferences.pageWidth;
        }
    var mySpreadArea = mySpreadWidth * mySpreadHeight;
    var myImages = mySpreads[i].rectangles;
    var myTotalImageArea = 0;
    var myIndividualImageArea = [];
    for (var j = 0; j < myImages.length; j++) {
        var myImageGeometricBounds = myImages[j].geometricBounds;
        var myImageWidth = myImageGeometricBounds[3] - myImageGeometricBounds[1];
        var myImageHeight = myImageGeometricBounds[2] - myImageGeometricBounds[0];
        myIndividualImageArea[j] = (myImageWidth * myImageHeight);
        myTotalImageArea += myIndividualImageArea[j];
        }
    for (var j = 0; j < myIndividualImageArea.length; j++) {
        alert("Image percentage of total images on spread " + (i + 1) + " = " + (myIndividualImageArea[j] * 100) /myTotalImageArea);
        }
   alert("Total image percentage on spread " + (i + 1) + " = " + myTotalImageArea);
   }

Tags: InDesign

Similar Questions

  • Need a script to the list name VM, the guest operating system, data store...

    I need to move a large number of virtual machines with MS Server 2008 to another storage.
    Could someone provide me with a small script for the list: all VM with GuestOS Type (MS Server 2008 filtered), name of store data and the overall computer virtual size!

    Thanks in advance

    Hello, farkasharry-

    How about something like:

    Get-View -ViewType VirtualMachine -Property Name,Config.GuestFullName,Storage.PerDatastoreUsage,Summary.Storage -Filter @{"Config.GuestFullName" = "Windows.*2008.*"} | %{    ## get the name(s) of the datastores on which this VM resides    $strDatastoreNames = ($_.Storage.PerDatastoreUsage | %{Get-View -Id $_.Datastore -Property Name} | %{$_.Name}) -join ","    New-Object -TypeName PSObject -Property @{        Name = $_.Name        GuestOS = $_.Config.GuestFullName        "Datastore(s)" = $strDatastoreNames        ## the amount of storage that the VM is using        UsedGB = [Math]::Round($_.Summary.Storage.Committed / 1GB, 1)        ## the total amount of storage that the VM _could_ use        ProvisionedGB = [Math]::Round(($_.Summary.Storage.Committed + $_.Summary.Storage.Unommitted) / 1GB, 1)    } ## end new-object} | Select Name, GuestOS, "Datastore(s)", UsedGB, ProvisionedGB
    

    It filters on the virtual machines with an OS name ("GuestFullName"), which corresponds to 'Windows.*2008. ' * ' and returns their name, the GuestFullName, the data store (s) on which they reside (maybe more), and the opportunity - and put into service in GB disk space.

    Return items are objects, so that you can select export to formats the info as you please, using the, say, Format-Table, Select-Object, Export-Csv, etc.

    And, because it uses the cmdlet Get-View, it should work pretty quickly.

    How does do for you?

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

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

  • Need a script to the first page as a resized jpg output

    Does anyone know a script where I can exit the front cover/first page of an indesign document as a tiny thumbnail jpeg?  Easy enough to do by hand, but a script would save a lot of time.

    Try this,

    var doc = app.activeDocument;
        w = doc.documentPreferences.pageWidth;
    doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.pixels;
    doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.pixels;
    
    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
    app.jpegExportPreferences.exportResolution = 300/w*72;
    app.jpegExportPreferences.pageString = doc.pages[0].name;
    doc.exportFile(ExportFormat.JPG, new File(doc.fullName.toString().replace(/\.indd$/i,".jpg")), false);
    

    Kind regards

    Cognet

  • Need a script to the list of all the virtual machines in CSV

    I want to record a list of virtual machines from one host in a csv file so that I can add to their return with

    New-VM - VMFilePath $VMXFile - $vmhost $ESXHost - $VMFolder location

    I started with that, but am struggling with the name of the folder of the virtual machine (can be used in New-VM-map)

    Get-VIServer-Server MyServer - protocol https-Force | out-null

    $report = @)

    Get - VM | Get-View | %{

    $row = "" | Select Name, VmPathName, location

    $row. Name = $_. Name

    $row. VmPathName = $_. Config.Files.VmPathName

    # $row. Location = $_. Folder # faced with this line

    $report += $row

    }

    $report

    # How to make this online, don't invite not not the user?

    Disconnect-VIServer-Server MyServer - Force

    Try this, it should give the blue files

    New-VIProperty -Name 'BlueFolderPath' -ObjectType 'VirtualMachine' -Value {    param($vm)
    
        function Get-ParentName {        param($object)
    
            if($object.Folder) {            $blue = Get-ParentName $object.Folder            $name = $object.Folder.Name        }        elseif($object.Parent -and $object.Parent.GetType().Name -like "Folder*") {            $blue = Get-ParentName $object.Parent            $name = $object.Parent.Name        }        elseif($object.ParentFolder){            $blue = Get-ParentName $object.ParentFolder            $name = $object.ParentFolder.Name        }        if("vm","Datacenters" -notcontains $name) {            $blue + "/" + $name        }        else{            $blue        }    }
    
        (Get-ParentName $vm).Remove(0,1)} -Force | Out-Null
    
    Connect-VIServer -Server MyServer -Protocol https -Force | out-null
    
    $report = @()Get-VM  | %{  $row = "" | select Name, VmPathName, Location  $row.Name = $_.Name  $row.VmPathName = $_.ExtensionData.Config.Files.VmPathName  $row.Location = $_.BlueFolderPath  $report += $row}$report
    
    Disconnect-VIServer -Server MyServer -Confirm:$false
    
  • Need a script to the Lun ID list

    01

    02

    03

    04

    05

    06

    07

    08

    09

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    functionGet-FreeScsiLun{

    param(

      [parameter(ValueFromPipeline= $true,Position=1)]

      [ValidateNotNullOrEmpty()]

      [VMware.VimAutomation.Client20.VMHostImpl]

      $VMHost

      )

      process{

        $storMgr= Get-View$VMHost.ExtensionData.ConfigManager.DatastoreSystem

        $storMgr.QueryAvailableDisksForVmfs($null) | %{

          New-ObjectPSObject-Property@{

            VMHost = $VMHost.Name

            CanonicalName = $_.CanonicalName

            Uuid = $_.Uuid

            CapacityGB = [Math]::Round($_.Capacity.Block * $_.Capacity.BlockSize / 1GB,2)

          }

        }

      }

    }

    $esx= Get-VMHost-NameMyEsx

    Get-FreeScsiLun-VMHost$esx| Format-List

    Try like this

    Function Get-FreeScsiLun {}

    (param

    [parameter (ValueFromPipeline = $true, Position = 1)]

    [ValidateNotNullOrEmpty()]

    [VMware.VimAutomation.Client20.VMHostImpl]

    $VMHost

    )

    {in process

    $storMgr = get-view $VMHost.ExtensionData.ConfigManager.DatastoreSystem

    $storMgr.QueryAvailableDisksForVmfs ($null) | %{

    $result = $_

    $lun = $VMHost.ExtensionData.Config.StorageDevice.ScsiLun | Where {$_.} CanonicalName - eq $result. CanonicalName}

    $lunId = $VMHost.ExtensionData.Config.StorageDevice.ScsiTopology.Adapter | %{

    $_. Goal | %{$_. LUN | where {$_.} {{ScsiLun-match $lun.key}}

    }

    New-object PSObject-property @ {}

    VMHost = $VMHost.Name

    CanonicalName = $_. CanonicalName

    Monday = if ($lunId) {$lunId [0].} LUN} else {"na"}

    UUID = $_. UUID

    CapacityGB = [Math]: tour ($_.) Capacity.Block * $_. Capacity.BlockSize / 1 GB, 2)

    }

    }

    }

    }

    $esx = get-VMHost-name MyEsx

    Get-FreeScsiLun - VMHost $esx | Format-List

  • Need a script to display the hidden field if number = 568845

    Hi all

    Using Acrobat Pro 9.1 on iMac with OS 10.6.8

    I am working on a form to fill out and need a script to display a hidden field when a button is clicked.

    I've set up a numeric field to type a number, and the hidden field is "text1".

    Now, I need a script to the button open only the hidden field, if the field number = 568845

    In this way the customer can fill in the code and then show and type in the field.

    Any help would be appreciated.

    Ron

    Given that you use it by a button, you can't use event.value because a button has no value, and in any case, you want to check the value of another field. So this place like your button MouseUp event (of course, you have to adapt the name of the text field...):

    If (this.getField("Text1").value == "568845") {this.getField ("Hidden_Field") .display = display.visible} else {this.getField('Hidden_Field').

    display = display.hidden}

  • Path to script whether the version is CC 2015.1?

    I need my script whether the version is CC 2015.1 or an earlier version of CC 2015.  I use parseInt (app.version) to determine the version number.  This report 16 CC 2015.1 and also older versions of CC 2015 as well.  Is there a way to determine what is the revision of the actual release?

    ' Important: "+ app.version.split(".") '" [0] + ", minor:"+ app.version.split(".")" [1] + ", difficulty:"+ app.version.split(".") ". [2]

    Result: Major: 16, minor: 1, Fix: 0

  • Need a script for marginal elements consists of two tags

    Hello world

    I need a script for the marginal elements with two paragraph tags. Object styles, library items are all available for this work. My requirement is to cut two paragraph tags and put it in the library and also using styles of both object elements. Is this possible? Can help you to do this. For more information, I have attached this file also.Screen shot 2011-04-05 at 4.41.13 PM.png

    Waiting for your answer...

    Hi try this code...

    main();
    main() {} function
    If {(app.documents.length!=0)}
    {if(App.Libraries.Length!=0)}
    myStyleDialog();
    }
    else {}
    Alert ("Please open library.");
    }
    }
    else {}
    Alert ("Please open a document and try again.');
    Exit (0);
    }
    }

    function myStyleDialog() {}
    var myLabelWidth = 120;
    var myParaStyleNames = myGetParagraphStyleNames();
    var myObjStyleNames = myGetObjectStyleNames();
    myDialog = app.dialogs.add var ({name: "Choose the Styles instead of anchoring"});
    {with (MyDialog.dialogColumns.Add ())}
    {with (borderPanels.Add ())}
    {with (dialogColumns.Add ())}
    {with (dialogRows.Add ())}
    {with (dialogColumns.Add ())}
    staticTexts.add ({staticLabel: "choose paragraph Style1:", minWidth:myLabelWidth});})
    }
    {with (dialogColumns.Add ())}
    myParaStyleDropdown1 = dropdowns.add ({stringList:myParaStyleNames, selectedIndex:0});})
    }
    }
    //---------
    {with (dialogRows.Add ())}
    {with (dialogColumns.Add ())}
    staticTexts.add ({staticLabel: "choose paragraph Style2:", minWidth:myLabelWidth});})
    }
    {with (dialogColumns.Add ())}
    myParaStyleDropdown2 = dropdowns.add ({stringList:myParaStyleNames, selectedIndex:0});})
    }
    }
    //----------
    ~ {with (dialogRows.add ())}
    ~ {with (dialogColumns.add ())}
    ~ staticTexts.add ({staticLabel: "Object Styles:", minWidth:myLabelWidth});})
    //~                             }
    ~ {with (dialogColumns.add ())}
    ~ myObjectStyleDropdown = dropdowns.add ({stringList:myObjStyleNames, selectedIndex:0});})
    //~                     }
    //~         }
    }
    }
    myReturn = myDialog.show ();
    if(myReturn == true) {}
    myParagraphStyle1 = myParaStyleNames [myParaStyleDropdown1.selectedIndex];
    myParagraphStyle2 = myParaStyleNames [myParaStyleDropdown2.selectedIndex];
    myObjectStyle = myObjStyleNames [myObjectStyleDropdown.selectedIndex];
    myDialog.destroy ();
    }
    else {}
    myDialog.destroy ();
    }
    }
    }
    function myGetParagraphStyleNames() {}


    var myStyleNames = app.documents.item (0).paragraphStyles.everyItem () .name;
    Return myStyleNames;
    }
    ~ function myGetObjectStyleNames() {}
    ~ var myObjStyleNames = app.documents.item (0).objectStyles.everyItem () .name;
    ~ return myObjStyleNames;
    //~ }

    //----------------------------------------------
    myDoc var = app.activeDocument;
    var myDoc.stories = monarticle;
    var myParas, myCount = 0;
    myLib var = app.libraries [0];
    var AnchorItemName = prompt ("Enter the name of library point exactly", "", "anchor point");

    for (i = 0; i
    {
    myParas = .paragraphs [i] monarticle;
    If (myParas.length > 3)
    {
    for (j = 0; j
    {
    firstPara var = myParas [j];
    var nextPara = myParas [j + 1];
    var firstParaStyle = firstPara.appliedParagraphStyle.name;
    var nextParaStyle = nextPara.appliedParagraphStyle.name;
    If ((nextParaStyle == myParagraphStyle2) &&(firstParaStyle == myParagraphStyle1))
    {
    myText = myLib.assets.item (AnchorItemName) .placeAsset (firstPara.insertionPoints [0]) [0];
    firstPara.move (LocationOptions.after, myText.insertionPoints [0]);
    nextPara.move (LocationOptions.after, myText.insertionPoints [-1]);
    myText.fit (FitOptions.frameToContent);
    myCount ++;
    } //End If
    } //End of iteration Para
    } //End of If paralength > 2
    } //End of iteration history
    Alert ("Found and dealt with Occurrences" + myCount);

    --------------

    Green4ever

  • We cannot pull a script using the grid control?

    Hi all
    II need a script for the table and the indexex which is present in the database.
    Is it possible to remove a script for this purpose in gridcontrol?

    Thank you

    In the console...

    1. go on the homepage of the database
    2. in the tab "schema".
    3. on the link of the table or index
    4. connect to the database
    5. Select the schema
    6. Select the table or index
    7. in the drop action, select 'generate the ddl' and click 'go '.

    Best regards
    Robert

  • Inline images/links/equations - need to script the space or/and/after...

    He

    work on some textbooks of mathematics. text is written in the word with many mathtype equations and imported in indd.

    some inline equations have space around, some don't.

    need a script to clean it. hold 1 space around each equation (before and after).

    Thank you

    Then, test the ExtendScript (JavaScript):

    // InsertSpaceBEFORE-AFTER-Anchored-GraphicFrame-v4.jsx
    // Uwe Laubender
    
    // NOTE: Text in tables or text in footnotes will ALSO be handled.
    
    /**
    * @@@BUILDINFO@@@ InsertSpaceBEFORE-AFTER-Anchored-GraphicFrame-v4.jsx !Version! Sun Jan 10 2016 15:56:14 GMT+0100
    */
    
    app.findGrepPreferences.findWhat = app.changeGrepPreferences.changeTo = "";
    
    // Here we could also look after "" with a text search!
    // A GREP search for "\\x{FFFC}" will ALSO work.
    app.findGrepPreferences.findWhat = "~a";
    
    var whatToAddBefore = " "; // A single space
    var whatToAddAfter = " "; // A single space
    
    // The focus is on our active document:
    var doc = app.documents[0];
    
    // Let's find every anchored object in the document in reverse order:
    var foundResults = doc.findGrep(true);
    
    // We are not interested in anchored text frames, anchored buttons etc.pp.
    // Just in anchored graphic frames, that contain graphics.
    // We could refine that even more, if we like.
    
    // So we loop the found special characters:
    
    for(var n=0;n
    

    Who should do it for you.

    You can remove the double and triple spaces thereafter.

    Uwe

  • I need a javascript script that would allow an image to import into the drive. I have a Mac so LiveC

    I need a javascript script that would allow an image to import into the drive. Only, I have a Mac so LiveCycle is not an option.

    Screen shot 2010-07-17 at 12.42.41 AM copy.jpg

    OrangeWhip area is where a user would click to download an image.

    Screen shot 2010-07-17 at 12.43.12 AM.jpg

    I found this form and unable to crack how to proceed. Any suggestions?

    For forms created with Adobe Acrobat read this:

    http://www.PlanetPDF.com/Enterprise/article.asp?contentid=import_images_into_field_with _

  • CS3: need script to replace spaces with underscores in the paragraph and character style names

    Help! I am very new to scripting.

    I managed to find and tweak existing javascripts to search through all my paragraph styles to disable hyphenation and off balance the jagged lines, but I need help with this one.

    I work on Mac OS 10.4.11 using Indesign CS3.

    I need a script that will search all my paragraph and character styles in my open Active document and replace spaces by underscores.

    Can someone help me with this? It would be greatly appreciated!

    1. I don't know, but I think you can use all the regular GREP inside this function codes. Do not use the quotation marks around of the expression, use slashes! (Why? Just a curiosity of Javascript... maybe a hack that goes back to the gray mist of JS development...)

    This work should - but rather the code above, this is not tested:

    .. Replace (/ [-\ / ()-. _] + / g. '_');

    The GOLD group inbetween the brackets contain all the characters you want to replace with an underscore: the hyphen (this has to be the first character in the group, else it will be interpreted as a range of characters from each side!), space, slash (this one is 'special' inside the function replace JavaScript, so I think he needs to escape with a backslash)! in parentheses, a period (not sure if it should escape - into ordinary GREP, it's the wildcard character for any character, but maybe he loses his magic within a group of GOLD) and finally... the underscore character. Why?

    Well, this replacement string comes with a free bonus. Note the sign after the installment of GOLD +. This means that a whole sequence of these characters is replaced by a simple underscore: "it's / a - / test" will become "This_is_a_test". Adding the underscore line itself to the string of research means that it will also find the whole chain 'space space (stroke underscore)' in 'This style (_)' and, oh magic!, replace it immediately with a single underscore.

    Just FYI, the tiny "g" after the closing slash is abbreviation of 'global', i.e. at the global level, replacing in this string. replace the default values for a replacement only (why? see above...), and adding the 'g' ensures he keeps replacing until it is not find matches more.

    2 see point 1.

    3. uh, yes it's true, but you will need to check very carefully if nothing inside one of these basic models is substituted. You can apply a base style and add substitutions to make look like a subtitle, but that isn't making it a. And to the next paragraph, you can apply a base style and add substitutions to make it look like a paragraph of plain text (etc.). It's a signature of witness to bad formatting...

  • I need to create combinations of text and images for the web. How to do this in elements or do I need Photoshop for this feature?

    I need to create combinations of text and images for the web. How to do this in elements or do I need Photoshop for this feature?  Please advise!

    slynn5236 wrote:

    I need to create combinations of text and images for the web. How to do this in elements or do I need Photoshop for this feature?  Please advise!

    You can do in PSE.

    1. Do the math to see how much space you'll need on your canvas to the image and text.
    2. Navigate to the file queue > new.blank. Enter the width & height, background color, resolution 72 px / in. It is your canvas, and in the layers palette will be the background layer.
    3. Copy and paste the image. It turns on a separate layer
    4. Activate the tool move, position the image and resize if necessary
    5. Activate the text tool, and then type your text. It will be on a separate so layer
    6. Position the text.
    7. Flatten layers and go to file > save for web. I'm usually on the long side about 800 px. Don't forget to check "constrain proportions". Adjust the quality slider to suit. You will probably want the type of JPEG file for web work.

Maybe you are looking for