help for the script

Hello team

[I wrote the script for collecting host information, basically I get some information is correctly, but for some fields, I'm System.Object]

Here's the script for any domain

vnic vnicspec pnicdevice pnicmac pnickey pnicdriver nodewwn hbadevice fagit linkspeed vswitch

I'm System.Object [], kindly help

# Handler VM guests

$objHosts = @)

$vmhosts = get-vmhost

If ($null - eq $vmhosts) {}

write-host ' Retry «$VIServ»»

$vmhosts = get-vmhost

}

# for each host download the info from the inventory, I want to...

{foreach ($vmhost to $vmhosts)

$vmhostview = $vmhost | Get-View

$objHost = "" | Select

Region, name, OSType, OSFullName, OSVersion, OSBuild, vendor, model, UUID, MemorySize, CpuModel, CpuMHz, NumCPuPkgs, NumCPuCores, Vm

otionEnabled, ESXHostID, vmnicscount, hbacount, OCPU, OMEM, uptime, memreservation, cpureservation, memlimit, cpulimit, prdley, vs

witch, vnic, vnicspec, pnicdevice, pnicmac, linkspeed, pnickey, pnicdriver, nodewwn, hbadevice, lboot, ClusterID, fagit

write-host "host treatment for ' $vmhostview. Name

$objHost.Region = $Region

$objHost.Name = $vmhostview. Name

$objHost.OSType = $vmhostview. Config.product.Name

$objHost.OSFullName = $vmhostview. Config.product.FullName

$objHost.OSVersion = $vmhostview. Config.product.Version

$objHost.OSBuild = $vmhostview. Config.product.Build

$objHost.Vendor = $vmhostview.summary.hardware.Vendor

$objHost.Model = $vmhostview.summary.hardware.Model

$objHost.UUID = $vmhostview.summary.hardware.UUID

$objHost.MemorySize = ([int] ($vmhostview.summary.hardware.MemorySize / 1 MB))

$objHost.CpuModel = $vmhostview.summary.hardware.CpuModel

$objHost.CpuMhz = $vmhostview.summary.hardware.CpuMhz

$objHost.NumCPuPkgs = $vmhostview.summary.hardware.NumCPuPkgs

$objHost.NumCPuCores = $vmhostview.summary.hardware.NumCPuCores

$objHost.VmotionEnabled = $vmhostview.summary.config.VmotionEnabled

$objHost.ESXHostID = $vmhostview.moref.value

$objHost.vmnics = $vmhostview.summary.hardware.numnics

$objHost.vmhbas = $vmhostview.summary.hardware.numhbas

$objHost.lboot = $vmhostview.summary.runtime.Boottime

$objHost.OCPU = $vmhostview.summary.quickstats.overallCPUusage

$objHost.OMEM = $vmhostview.summary.quickstats.overallMemoryUsage

$objHost.uptime = $vmhostview.summary.quickstats.Uptime

$objHost.memreservation = $vmhostview.config.systemresources.config.memoryallocation.reservation

$objHost.cpureservation = $vmhostview.config.systemresources.config.cpuallocation.reservation

$objHost.memlimit = $vmhostview.config.systemresources.config.memoryallocation.limit

$objHost.cpulimit = $vmhostview.config.systemresources.config.CPUallocation.limit

$objHost.prdley = $vmhostview.config.network.portgroup.key

$objHost.vswitch = $vmhostview.config.network.portgroup.vswitch

$objHost.vnic = $vmhostview.config.network.vnic.portgroup

$objHost.vnicspec = $vmhostview.config.network.vnic.spec.mac

$objHost.pnicdevice = $vmhostview.config.network.pnic.device

$objHost.pnicmac = $vmhostview.config.network.pnic.mac

$objHost.linkspeed = $vmhostview.config.network.pnic.linkspeed

$objHost.pnickey = $vmhostview.config.network.pnic.key

$objHost.pnicdriver = $vmhostview.config.network.pnic.driver

$objHost.Nodewwn = $vmhostview.config.storagedevice.hostbusadapter.NodeWorldWideName

$objHost.portwwn = $vmhostview.config.storagedevice.hostbusadapter.PortWorldWideName

$objHost.hbadevice = $vmhostview.config.storagedevice.hostbusadapter.device

$objHost.ClusterID = ($vmhost |) Get - Cluster). Name

$objHosts = $objHosts + $objHost

}

# Write the host inventory to a CSV...

$Filename = "ESX_Host_Report1.csv".

$objHosts | Export-Csv $Filename - noType

No tricks, just a join of elements in the array.

# Get the VM guests

$objHosts = @)

$vmhosts = get-vmhost

If ($null - eq $vmhosts) {}

write-host ' Retry «$VIServ»»

$vmhosts = get-vmhost

}

# for each host download the info from the inventory, I want to...

{foreach ($vmhost to $vmhosts)

$vmhostview = $vmhost | Get-View

$objHost = "" | Select

Region, name, OSType, OSFullName, OSVersion, OSBuild, vendor, model, UUID, MemorySize, CpuModel, CpuMHz, NumCPuPkgs, NumCPuCores, Vm

otionEnabled, ESXHostID, vmnicscount, hbacount, OCPU, OMEM, uptime, memreservation, cpureservation, memlimit, cpulimit, prdley, vs

witch, vnic, vnicspec, pnicdevice, pnicmac, linkspeed, pnickey, pnicdriver, nodewwn, hbadevice, lboot, ClusterID, fagit

Write-Host "host treatment for ' $vmhostview. Name

$objHost.Region = $Region

$objHost.Name = $vmhostview. Name

$objHost.OSType = $vmhostview. Config.product.Name

$objHost.OSFullName = $vmhostview. Config.product.FullName

$objHost.OSVersion = $vmhostview. Config.product.Version

$objHost.OSBuild = $vmhostview. Config.product.Build

$objHost.Vendor = $vmhostview.summary.hardware.Vendor

$objHost.Model = $vmhostview.summary.hardware.Model

$objHost.UUID = $vmhostview.summary.hardware.UUID

$objHost.MemorySize = ([int] ($vmhostview.summary.hardware.MemorySize / 1 MB))

$objHost.CpuModel = $vmhostview.summary.hardware.CpuModel

$objHost.CpuMhz = $vmhostview.summary.hardware.CpuMhz

$objHost.NumCPuPkgs = $vmhostview.summary.hardware.NumCPuPkgs

$objHost.NumCPuCores = $vmhostview.summary.hardware.NumCPuCores

$objHost.VmotionEnabled = $vmhostview.summary.config.VmotionEnabled

$objHost.ESXHostID = $vmhostview.moref.value

$objHost.vmnics = $vmhostview.summary.hardware.numnics

$objHost.vmhbas = $vmhostview.summary.hardware.numhbas

$objHost.lboot = $vmhostview.summary.runtime.Boottime

$objHost.OCPU = $vmhostview.summary.quickstats.overallCPUusage

$objHost.OMEM = $vmhostview.summary.quickstats.overallMemoryUsage

$objHost.uptime = $vmhostview.summary.quickstats.Uptime

$objHost.memreservation = $vmhostview.config.systemresources.config.memoryallocation.reservation

$objHost.cpureservation = $vmhostview.config.systemresources.config.cpuallocation.reservation

$objHost.memlimit = $vmhostview.config.systemresources.config.memoryallocation.limit

$objHost.cpulimit = $vmhostview.config.systemresources.config.CPUallocation.limit

$objHost.prdley = $vmhostview.config.network.portgroup.key

$objHost.vswitch = $vmhostview.config.network.portgroup.vswitch

$objHost.vnic = $vmhostview.config.network.vnic.portgroup

$objHost.vnicspec = $vmhostview.config.network.vnic.spec.mac

$objHost.pnicdevice = $vmhostview.config.network.pnic.device - join ' | '

$objHost.pnicmac = $vmhostview.config.network.pnic.mac - join ' | '

$objHost.linkspeed = $vmhostview.config.network.pnic.linkspeed - join ' | '

$objHost.pnickey = $vmhostview.config.network.pnic.key - join ' | '

$objHost.pnicdriver = $vmhostview.config.network.pnic.driver - join ' | '

$objHost.Nodewwn = $vmhostview.config.storagedevice.hostbusadapter.NodeWorldWideName - join ' | '

$objHost.portwwn = $vmhostview.config.storagedevice.hostbusadapter.PortWorldWideName - join ' | '

$objHost.hbadevice = $vmhostview.config.storagedevice.hostbusadapter.device - join ' | '

$objHost.ClusterID = ($vmhost |) Get - Cluster). Name

$objHosts = $objHosts + $objHost

}

# Write the host inventory to a CSV...

$Filename = "ESX_Host_Report1.csv".

$objHosts | Export-Csv $Filename - noType

Tags: VMware

Similar Questions

  • Help change the script to a report

    I tried, but have been unable to make this script in a report.  Here's the script I would like to make a report:

    {foreach ($VMHost in Get-VMHost)
    $esx = get-view-Id $VMHost.id
    {foreach ($vSwitch to $esx.Config.Network.Vswitch)}
    Write-Host $vSwitch.Name
    Write-Host "' tmac changes:" $vSwitch.Spec.Policy.Security.macChanges
    Write-Host "' tForged passes:" $vSwitch.Spec.Policy.Security.ForgedTransmits
    }
    }

    I would also add the esx host name in the output.  I would like the output to this format if possible:

    esxservername, mac, wrought changes passes

    I was looking at this script as sort of a model, but when I went to replace parts of the script it just did not work properly.  This script is the VM information, but I'm looking for the script above be put in this type of report format.  Or am I wrong in that the script above is only good for just posting out on-screen during the launch in powerCLI?

    $report = foreach ($vm in (Get - VM | where {$_.})) PowerState - eq 'Receiving'})) {}
    Get-NetworkAdapter - VM $vm | `
    Select @{N = "VMname"; E = {$vm. Name}},
    @{N = "MAC address"; E={$_. MacAddress}}
    }

    $report | Export-Csv «.\output.csv"- NoTypeInformation - UseCulture

    Thanks in advance for any help.

    Hi Mark,

    The following script will give you the report of your choice:

    Get-View -ViewType HostSystem | ForEach-Object {
      $VMHostView =$_
      $VMHostView.Config.Network.vSwitch | ForEach-Object {
        $Report = "" | Select-Object -Property VMHost,vSwitch,"MAC Changes","Forged Transmits"
        $Report.VMHost = $VMHostView.Name
        $Report.vSwitch = $_.Name
        $Report."MAC Changes" = $_.Spec.Policy.Security.macChanges
        $Report."Forged Transmits" = $_.Spec.Policy.Security.ForgedTransmits
        $Report
      }
    }
    

    Best regards, Robert

  • There is no help for the usrp blocks screens

    For power, where are the docs for help for the USRP & USRP related blocks (host side & lvfpga blocks)? Help is dimmed in the menus. If they came with the driver, they should be grouped in with something not obvious & has not installed. Where are they?

    BTW, I use NU-USRP 15.00.

    Thank you.

    apchar,

    Try to use context-sensitive help on the pilot of the USRP RIO screw Either click on the "?" in the upper right corner of the block diagram, or press Ctrl-H and hover over the screws of RIO USRP. You should see the additional help documentation.

  • I need help for the upgrade of my current system.

    I need help for the upgrade of my current system.

    I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.

    I want to make the larger environment using the following:

    (1) apply Virtualization

    (2) apply to the failover process (clustering)

    "(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.

    Storage 4) that supports Raid (1 and 5)

    UTM excellent 6) that supports (SSL VPN, VPN Global)

    suitable backup solution 7)

    (8) good antivirus for clients

    my questions:

    (1) can you provide me with a good design for this environment

    (2) should I choose what operating system:

    Microsoft datacenter or company

    I know datacenter provide us the unlimited VM but needs per processor license

    so if I have two Grouped servers I want to buy 4 licenses

    and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?

    (3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?

    (4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?

    (5) what about win2k8 license for VM:

    lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?

    (6) can I use backExec license for SBS with windows 2008 standard

    (7) who better to virtualization AMD or INTEL

    (8) hyper V or VMware?

    (9) what of Microsoft data protection Manager... is this good?

    (10) what virtual machine manager? What are the benefites keys

    Thanks in advance

    Hello AnasAI,

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • How to install a local help for the tools of cmd.exe and command line on Windows 7?

    Hello

    for many applications, the command line (cmd.exe) is a good choice to get results with minimum effort. The shell has continuously been improved over the years, at least until Windows XP.

    All the command line tools have a short help screen (using the /? option). When you need more information, you use Windows system for example from the Explorer Help. It is very good.

    Now, Windows XP Help content was installed on site, and the operating system. In Windows 7, my computer wants to go to the Microsoft web site on the internet and there is no local help available. The operating system seems to be incomplete. This makes the help system unusable on a computer without internet access or when the server is not accessible.

    So my question is: is it possible to install a local copy of help for the tools of cmd.exe and command line under Windows 7 or do we have to go back to Windows XP?

    Thank you

    Martin

    Download it directly from Microsoft - Windows Command Reference

  • Where can I find help for the companion of XBox Music App, App for video, or for games of XBox Live?

    Where can I find help for the companion of XBox Music App, App for video, or for games of XBox Live?

    You can find the sites of support for these applications at the following locations:

    Music App support:

    App video support

    Xbox companion support

    Support Xbox Live games:

  • After using the iphone app, I get error: "unable to get labels for the script.

    Hello

    I think that this is related to the iphone app for Adobe Story. I added some comments on my script using the application, now when I try and open my script, I get an error; "Unable to get labels for the script.

    I tried Internet Explorer 9 and the desktop application. Both produce the same error.

    The script is completed to 55 pages, so I really don't want to lose...

    Thank you

    Hi Chris,

    We have fixed the problem and shared the document with you back. You can accept the notification, copy the document into a new (to be an owner) and work on it now. Meanwhile, we will also investigate why the problem occurred at all.

    Sorry for the inconvinience.

    Kind regards

    Sunny

  • looking for help on the script PowercLI.

    I'm looking for a script powershell group based vmsessions on the State of vmtools version so that I can plan the upgrade to version VMtools on virtual machines.

    Please use the below script and let me know if problems.

    Claire

    $logfile = "result.txt".

    $vms = «»

    $output = «»

    $temp =""

    $vm =""

    To connect to vcenter Server

    $vcenter = read-host "enter the vCenter Instance.

    to connect-viserver-Server $vcenter - WarningAction SilentlyContinue

    Get-Date | out-file $logfile

    echo "= details = | out-file $logfile - Append

    $vms = get-Content.\list.txt

    $output = get - vm $vms | SELECT name, vmhost, PowerState, version, toolsversion, toolsversionstatus, comments.

    | Tri-objet-property toolsversionstatus | FT - AutoSize GroupBy - toolsversionstatus-wrap

    $output

    $output | Out-file $logfile - append

    Disconnect-VIServer *-confirm: $false

  • The use of .vas and for the script .lst files.

    Hello

    I'm working on a script about tiara for the treatment of the channels (involving Crash module). I saw a few scripts using *.vas and *.lst files to define variables and measures for different cases and all.
    I would like to understand more about the features of said make use in my scripts. I looked on the internet for explanations about the same but do not have something useful.

    It would really help me if there is some links or examples for them.

    Thanks in advance,

    Kind regards
    Fazil Shah.

    Hi faz_mah,

    In this case I recommend using two objects dictionary, TypeDict, and PriceDict, like I showed you above.  Or color you use the object than a dictionary and store and array values (type, price, etc.) with each name of the search.  Enumeration style variables "A" in the *.vas file have a static list of enumeration values and variables for enumeration of type 'G' in the file menu of *.vas their dynamic list of values from the file * .lst - which means that you would have to add rows at the end of the file list to add rows to the table of the above possibilities.  It would be faster and more easy to avoid the hard drive and use a dictionary object or two.

    If you're still not convinced, I can send you an example of creating a variable of type *.vas 'G '.

    Brad Turpin

    Tiara Product Support Engineer
    National Instruments

  • solution for the script error and what it

    I'm not very tech savy, so I need details on how to solve this problem and what he does. I got a script error the reads as follows:

    Online: 52

    Char: 2

    Error: Cannot move the focus to the control because it is invisible, not enabled, or of a type that does not accept focus.

    Code: 0

    URL: file:///C:/Program%20Files/HP/Digital%

    20Imaging/skins/HP1/UL/js/unload_startup.js

    Please be gental with the solution, as I said I'm not a programmer at all. I recently had a virus and my computer "cleaned" and had reinstalled it. So this might help explan the problem. I have also problems with Windows media player.

    When I encountered this problem I have installed software from a disc to a new digital camera.

    Thanks in advance for your help

    Hi famcole1,

    1. do you have an Antivirus installed on the computer software?
    2. what questions do you have with Media Player?

    Disable the script debugger, and then check the issue.

    a. open Internet Explorer, click Tools and then click Internet Options.

    b. in the Internet Options dialog box, click the Advanced tab.

    c. Click to select the script turn off debugging (Internet Explorer) and disable script debugging (other) check boxes, and then click to clear the display a notification of every script error box.

    d. click OK to close the Internet Options dialog box.

    Review the links below, I'm sure that this will help solve your problem better:

    How to fix script errors in Internet Explorer on Windows computers?
    http://support.Microsoft.com/kb/308260

    To keep your computer safe in the future, you can useMicrosoft Security Essentials , which is a free software from Microsoft, which provides coverage in real time to your PC at home that protects against viruses, spy software and other malicious software.

    Kind regards
    Manasa P - Microsoft technical support.

  • Request for relief for the script code

    I would like to help with this script in our field of personalised calculation of adjustment:

    Get the field values as numbers

    var goals = + getField("Goals").value;

    var GA1 = + getField("GA1").value;

    var GB1 = + getField("GB1").value;

    var = GC1 + getField("GC1").value;

    var GD1 = + getField("GD1").value;

    Set this field value

    switch (goals) {}

    case 1:

    Event.Value = GA1;

    break;

    case 2:

    Event.Value = (GA1 + GB1) / 2;

    break;

    case 3:

    Event.Value = (GA1 + GB1, GC1) / 3;

    break;

    case 4:

    Event.Value = (GA1, GB1, GC1 + GD1) / 4;

    break;

    by default:

    Event.Value = "";

    break;

    }

    It was written when 'Goals' our form had the numbers 1 to 4 in option.  Now we have between 0 and 4 in option - so there should not be a 'case 0' is added to this?

    Thanks for any help you can give.

    Change these two lines:

    switch (Goals) {
    case 1:
    

    TO:

    switch (Goals) {
    case 0:
        event.value = 0;
        break;
    case 1:
    
  • Need a developer for the script: distribute symbols on a path and rotate

    Hi all

    I need an Illustrator script to distribute a collection of different symbols on a trace. The symbols must be distributed from the beginning at the end of the path and separated by a proportional space between them. In addition, each symbol should be turned pointing to an object "look."

    Please look at the picture as an attachment for more information.

    path.jpg

    Any help will be appreciated. I know that nobody is here to develop scripts for free so let's talk

    @carlostelemaco

    I am happy.

    But the script "Divide (length)" works for each segment.

    So it is not usable for the purpose which divides all the way having different lengths of segments.

    I wrote a script to process 1 and 2.

    However, it is a little rough implementation for now.

    Please try this.

    http://shspage.com/aijs/af_distributeOnThePath.zip

    @W_J_T, @pixxxel schubser, @CarlosCanto

    Thank you. Let's have fun with the script!

  • Need help for calculation script

    I was instructed to convert an Excel file into a fillable PDF, with formulas and calculations. Unfortunately, I'm a complete newbie to creating forms using calculations and javascript, but so far, I was able to use the built-in functions or to find examples of javascript for the formulas that I am duplicating. However, my final calculation stuck me.

    Basically, I do an if / then calculation based on a field being greater or less than another. If the result is greater, the script should return a 'YES', if it is lower, it should return a 'no' the excel function is as follows:

    = IF(C45>C32,"YES","NO")

    Could someone help me with this script?

    Here is the code for calculating customized to do this, assuming that the names of the other fields are C45 C32 and that their format is set to number:

    c45 var = getField("C45").value;

    c32 var = getField("C32").value;

    If (c45! = "" & c32! = "") {}

    If the two fields are not empty, compare them...

    Event.Value = c45 > c32? "YES": "NO";

    } else {}

    If the fields are empty, reset this field

    Event.Value = "";

    }

  • newbie scripts... help for a script of brand 'simple' culture

    Hello

    I'm after some advice or assistance on the side of things for indesign script please.

    Basically where do you start? I am wanting to make scripts to speed up repetitive processes.

    What I'm trying to do in the first, it's (which I think would be) a very simple script. Basically it adds benchmarks of crop to document, with the horizontal joints across the width of the running document. I have just no idea where to start...

    So, I think that the process of the script would be as follows:

    1. find the size of the document

    2. Add a horizontal line to 0.1 pt size,
    Length = width of the document + 20mm
    X-axis = width of the document divided by 2 (driving is in the Center, suspended 10mm on the left and right edges)
    Axis Y = 0mm

    3. Add a horizontal line to 0.1 pt size,
    Length = width of the document + 20mm
    X-axis = width of the document divided by 2 (driving is in the Center, suspended 10mm on the left and right edges)
    Y-axis = height of the document

    4. Add a vertical line to 0.1 pt size,
    Length = 10mm
    Axis x = 0mm
    Y-axis = - 2 mm-12 mm (the bottom line is located at-2, top of the line at-12)

    5. Add a vertical line to 0.1 pt size,
    Length = 10mm
    X-axis = width of the document
    Y-axis = - 2 mm-12 mm (the bottom line is located at-2, top of the line at-12)

    6. Add a vertical line to 0.1 pt size,
    Length = 10mm
    Axis x = 0mm
    Axis Y = document height + 2mm, height of the document + 12 mm (top of the range is located at the height of the document + 2 mm, low line at the height of the document + 12 mm)

    7. Add a vertical line to 0.1 pt size,
    Length = 10mm
    X-axis = width of the document
    Axis Y = document height + 2mm at the height of the document + 12 mm (top of the range is located at the height of the document + 2 mm, low line at the height of the document + 12 mm)


    For the future, I'm wanting more complex scripts, but it will hopefully help me understand a little more.  (I will have one with tables of entry where you can add variables if it is feasible, but I think somehow it won't get this one!)

    Thanks in advance for any help or pointers.

    Phil

    As mentioned above, we can guide you step by step custom script

    Let me help you get started with this: help ESTK - or one of its variants - is your greatest friend!

    ' 1. find the size of the document.

    For the latter, use app.activeDocument.documentPreferences.pageWidth and app.activeDocument.documentPreferences.pageWidth.

    "2 Add a horizontal line to 0.1 pt size,
    Length = width of the document + 20mm
    X-axis = width of the document divided by 2 (driving is in the Center, suspended 10mm on the left and right edges)
    Axis Y = 0 mm"

    app.activeDocument.graphicLines.add () adds a new line graph on a default position. You can then move it into position.

    Do the mathematical results in this little script to add to the first line:

    newline = app.activeDocument.graphicLines.add ();

    newLine.paths [0] .pathPoints [0] .anchor = [-20, 0];

    newLine.paths [0] .pathPoints [1] .anchor = [app.activeDocument.documentPreferences.pageWidth + 20, 0];

    newLine.strokeWeight = 0.1;

    newLine.strokeColor = app.activeDocument.swatches.item ("Registration");

    newLine.strokeStyle = app.strokeStyles [0];

    A 'line' can consist of a number of paths (think of a compound path), but usually only one way. A new line has only two points of endpoint - anchors-, and you can move them by setting the coordinates with an array of [XY] values. Important: these values are in units of measure. I guess that, for practical reasons, you have mm for this. If you see lines of wide 20 inch arise, you know why :-) Another important point: the zero point leaders must be in the upper left corner of your document. All 'absolute' values are relative to this zero point.

    It is perfectly possible to have the script to set the correct measurements and move the point zero for you, but now you know why he has to do.

    Note that you do not explicitly move the center of the new line; in this case, it is easier to move immediately each endpoint in its correct place.

    There are a few other things you can do to make the script misbehave. The new line is created with the default Active values in your document. You could have the script to change the default values for the correct settings, but it's not really easy to use. Instead, you can change everything by applying the new values of the new line only. You can see that I put his weight, color, and style of outline.

    Some points on these three parameters of the latter:

    • No not just tell you that all the values are in common units of measure? Well, widths are always points (as is the font size and line spacing).
    • The correct line color is caught by asking a sample called 'Registration' - you might want to replace it with another swatch name.
    • The style of outline is caught blindly using the first style of outline in InDesign. I discovered the hard way using 'Solid' (or what's his name) does not work across different languages. Much later I learned there is a way independent of the language of the use of the names, but hey, it's harder to remember.
  • Help with the scripts of "event handler".

    Ok. I am new to using event handler and the Listener Script for I have not every little thing down yet.

    What I'm trying to do is set up an event handler to activate a script when I select a layer. As I have now, the active script no matter what I choose and I'm unable to limit it to only activate when I select a layer. The ScriptListener output was:

    var idslct = charIDToTypeID ("TPCV");
    var desc10 = new ActionDescriptor();
    var idnull = charIDToTypeID ("null");
    ref19 var = new ActionReference();
    var idLyr = charIDToTypeID ("Lyr");
    ref19.putName (idLyr, 'Face');
    desc10.putReference (idnull, ref19);
    var idMkVs = charIDToTypeID ("MKV");
    desc10.putBoolean (idMkVs, false);
    executeAction (idslct, desc10, DialogModes.NO);

    I used TPCV under the name of the event during the creation of the new event in the event handler. However, this same ID is used when a tool is selected. This isn't a huge problem, but for the fact that my reason for setting this up is so that when I select a layer, first I want to implement a predefined specific tool to use on it. If I can change the tools (select another tool) and have always the same layer selected in the script automatically selects the initial tool to the layer which is always selected this layer is always the active layer.

    Example: Suppose I have the following layers...

    Texture

    Heal

    Tones

    Eyes

    Lips

    Face

    These are not my normal layers, but for example when I select the layer "Cure" I would like to start with the Healing Brush tool. However, sometimes I want to use clone on this layer as well. Using the event at this time, Heal would still be the active layer when I make the choice to the clone tool so the script would then return the selected tool, Healing Brush tool.

    So, is it possible to limit the selection event ID to activate only when a layer is selected? I noticed that the line above in bold/red is the event ID of layer. I don't know how to do this in the event handler or the script.

    Thanks for any help.

    Mike

    Here ya go...

    //
    // SelectLayerHandler.jsx
    //
    
    function _selectLayerHandler(desc) {
      // do whatever when a layer is selected
      var doc = app.activeDocument;
      var layer = doc.activeLayer;
      alert("Layer " + layer.name + " selected");
    };
    
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    
    try {
      if (arguments.length >= 2) {
        var desc = arguments[0];
        var event = arguments[1];
        if (event == cTID('slct')) {
          var ref = desc.getReference(cTID('null'));
          var cls = ref.getDesiredClass();
          if (cls == cTID('Lyr ')) {
            _selectLayerHandler(desc);
          }
        }
      }
    } catch (e) {
      alert( "Error: " + e + ":" + e.line );
    }
    
    "SelectLayerHandler.jsx";
    // EOF
    

Maybe you are looking for

  • Can you help me with a configuration of dual monitor DVI?

    I went through a few weeks of effort with it and seeking a final solution... I have an i7 Mini - 2012 model.  Two identical Acer S241HL LED monitors.  I need the same video display DVI on both screens.  A single monitor, close proximity to the Mini..

  • Purchase of a MacBook Pro

    Hi all! Well, I have a little trouble deciding what Macbook Pro to buy. I want to stay with one of the models 13 inches (I'm going to be traveling very often and with a monitor in my office space). I need to be able to open multiple programs at the s

  • help to separate all of the data in the .csv file

    Hi all I have a CSV file and sometime I hv to reading one line and then set these parameters of instrument. and then second row and so on... But I always all data as in a line... I had to seprate them so I can give separate value to separate the para

  • Uninstall program Warning Message

    I opted, by mistake, not confirmation before unistalling a program. How to make the prompt message: ' are you sure you want to uninstall...? See rising again until I have uninstall a program? Thanks in advance!

  • my HP PSC 1610 does not print

    I have a dell dimension 2400 desktop under XP.  I try to install this PSC 1610 all-in-one printer.  I down loaded the software driver.  When I try to print the printer begins to run, and looks like it's printing, but the page comes out blank. My prev