Need help script
Hello
I'm new to this J.S. and need help.
I have 3 question fields (called Q1, Q2, and Q3 in a text format) and another 3 response (called A1, A2, and A3) in digital format. I need a beginning for this:
If T1 = Yes, then A1 = 1, if Q1 = none then A1 = 2 and so on...
The field A4 must be a sum of A1, A2, A3.
How to write a J.S. for above fields A1, A2, A3, and A4.
I use Adobe Acrobat Pro XI.
Thank you.
For some reason any you removed the word "else" at the beginning of the last line, if the value of the field is always set as an empty string... Add that and it will work.
Tags: Acrobat
Similar Questions
-
Need help script several dependencies to display hidden subform.
I try to make sure both boxes must be checked to show a hidden subform. I thought that the script would be something like this:
If (Check1.rawValue == 1)
& & (Check2.rawValue == 1) {}
Sub1.presence = "visible";
}
else {}
Sub1.presence = "Hidden";
}
It does not at all well, so I'm obviously wrong in my logic.
I am using LiveCycle Designer ES 8.2.1.
Any help is greatly appreciated. Kind of a stand still until I get this understood, otherwise I have to change how my document will be designed. Thank you.
Mike
I don't have LiveCycle but you from a javascript perspective you don't have all those parentheses in your statement. Try:
If (Check1.rawValue == 1 & Check2.rawValue == 1) {}
Sub1.presence = "visible";
} else {}
Sub1.presence = 'hidden ';
}
That's assuming that "Check1", 'Check2' and "Sub1" variables are configured to correctly reference the elements of your live cycle form. If these variables are right, then my if statement above should work for you.
If it still does not for you, you can try this announcement in the LiveCycle forums: http://forums.adobe.com/community/livecycle
-
I have a problem, try to uninstall the ask toolbar. get the error message: unable to access the VB script... need help
Hello
How do you try to uninstall the toolbar?
I would suggest trying the following methods and check if it helps.
Method 1:
Try the steps in the following Microsoft article and check if it helps.
How to fix script errors in Internet Explorer on Windows computers:
http://support.Microsoft.com/kb/308260
Correction of errors in Internet Explorer: http://support.microsoft.com/kb/822521
Method 2:
Try to uninstall the toolbar, programs and features and check if it helps.
Uninstall or change a program:
http://Windows.Microsoft.com/en-us/Windows-Vista/uninstall-or-change-a-program
Hope the information is useful.
-
I need help on the matrix of action script 3.0
I need help on the matrix of action script 3.0
[Ask in the correct forum allows... Left non-technical Forum Lounge for forum specific program... MOD]
to apply a matrix for mc mat oppose:
var mat: Matrix = new Matrix;
mat.a = Whatever;
mat.b =
mat.c =
mat.d =
mast. TX =
mat.Ty =
MC. Transform.Matrix = Matt;
-
Need help with understanding PowerCli scripting by LucD
Hello
I'll give you the standard statement that I am a noob powercli and don't really know what I'm doing here. Here's a script that works because it runs without error and gives a report but I need help to understand this under his weight.
Connect-VIServer '< our vcenter >' - user < user > admin-password < admin-user-pwd >
$allvms = @)
$vms = get - Vm | where {$_.} PowerState - eq "Receptor"}
$start = (get-Date). AddDays(-1)
$metrics = "mem.usage.average".
$stats = get-Stat-entity $vms - start $start - Stat $metrics
$stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{
$vmstat = "" | Select the day, MemAlloc, MemMin, MemMax, MemAvg, VmName
$vmstat. VmName = $_. Values [1]
$vmstat. Day = $_. Group [0]. Timestamp.Date
$mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum
$vmstat. MemMax = [int] $mem. Maximum ##dfsdf
$vmstat. MemAvg = [int] $mem. Average
$vmstat. MemMin = [int] $mem. Minimum
$vmstat. MemAlloc = $_. Group [0]. Entity.MemoryMB
$allvms += $vmstat
}
$allvms |
Export-Csv "c:\ < folder > \ <>.csv file Destination"-noTypeInformation
It connects to our server vcenter server and offers two days of data. Today and yesterday, all with a timestamp of 0:00. See below for an example of a virtual machine.
VmName Day MemAlloc MemMax MemAvg MemMin < name VM1 > 07/05/2016 0:00 4096 18 18 18 < name VM1 > 06/05/2016 0:00 4096 36 12 8
The MemMax, the MemAvg and the MemMin are for this day? Just the max of this period of sampling time 0:00?
What I'm looking for, it is to find that the use of the maximum memory of virtual machines are for the whole day. So I hope that I can remove memory of VMs that do not use it. I was listed on the change $start = (Get-Date). The value of AddDays(-1) to $start = (Get-Date). AddDays(-30) and see what things alike. I want to be sure however that the value for MemMax is the highest value for a period of 24 hours. That is to say for the 07/05/2016 the given virtual machine never used a maximum of 18% of his memory attributed the 06/05/2016 the maximum amount of memory used was 36%, and so on that I extend on the date range.
Kind regards
Michael
It then becomes a rather simple Get-Stat script.
$vms = get - Vm | where {$_.} PowerState - eq "Receptor"}
$start = (get-Date). AddDays(-1)
$metrics = "mem.usage.average".
Get-Stat - entity $vms - start $start - Stat $metrics |
Select Timestamp,@{N='VM'; E={$_. @entity.name}}, Value |
Tri-objet-VM property |
Export-Csv "c:\
------ .csv '-noTypeInformation -
Need help with custom script to rename the layers
Hello world.
I need help to write a custom script (because I suck at it) that will allow me to go through all the layers and sous-calques for a specific name ('X') and give it a new specific name ('Y').
I have had success using the script below, but it does not work on any text layers names where the text layer was previously particularly well-known in 'X' and now changed needs.
Any help is greatly appreciated.
* Note: this script was originally used to find any layer with 'Copy' in its name and remove with anything after (to correct the problem of duplication of layers by adding this text).
This is why the function is named removeCopy. It works for renaming layers also - just not a layer of text unfortunately.
#target illustrator function removeCopy() {} If (app.documents.length == 0) return; var app.activeDocument = docRef; recurseLayers (docRef.layers); } removeCopy(); function recurseLayers (objArray) {} for (var i = 0; i < objArray.length; i ++) {} ObjArr [i] .name = ObjArr [i].name.replace (/ \s*current name\s*\d*/, 'new name'); If (objArray [i] .layers) recurseLayers (. layers.length > 0 ObjArr [i]); } } I finally found something after searching forums for a week. My confusion was related to the way Illustrator treats real layers against text/path/object "layers." Instead of layers, I had to use the pageItems in the script. The code below works. Thanks to Gustavo for his answer in another thread and Carlos I thank you for this looking too good! You're great to be ready to help models do more advanced things with Illustrator.
var doc = app.activeDocument; var items = doc.pageItems; for (var g = 0; g) elements [g] .name = elements [g].name.replace ('Century Schoolbook text line', ' MonogramText: Century Schoolbook "); }; App.Redraw (); -
Good morning friends,
So for my work, I need a script to open files with the same name but located in a different folder. But since I'm a total noob when it comes to programming, I can't understand how do. That's what I have in mind:
-J' I manually open an image.
-The script will look for a file with the same name in another folder that I've specified.
-The script will then select the channel CMYK of the second file and copy and paste it into the first file.
-The second file is then closed without saving the changes.
I have problems with the part where the script searches for a file with the same name as the opened file. I would really appreciate help. Thanks in advance.
If (app.documents.length > 0) {}
myDocument var = app.activeDocument;
var Nomdoc = myDocument.name;
try {var basename = docName.match (/(.*)-.)} [ ^\.] +$/)[1]}
catch (e) {var basename = thedoc.name};
var path = / * path of folder to insert as a string here * / + ' / ' + base name + / * insert file extension, including the period as a string here * /;
If (queue (path) .exists == true) {var otherDocument = app.open (File (path))};
};
-
I have a script that will allow me to change the configurations of VRAM, but I need a script that retrieves the configuration of all virtual machines VRAM in my infrastructure.
I need to get out information to a csv file and run this report on a monthly basis... can you help me?Right now my environment is mixed. I have Windows XP virtual machines set to 4 MB, Windows 7 virtual computers set to 8 MB and a subset of sall of virtual machines set to automatic detection of settings.
I need to be able to recover these settings in a CSV file in order to use this information for comparisons of trdouble-shot performance issues...
Thank you.
Try something like this
Get - VM |
Select Name,
@{N = "OS"; E={$_. ExtensionData.Config.GuestFullName}},
@{N = "VideoRamMB"; E = {}
[math]: Round (($_.)) ExtensionData.Config.Hardware.Device |
where {$_-is [VMware.Vim.VirtualMachineVideoCard]} |
(Select VideoRamSizeInKB - ExpandProperty) / 1 Ko, 1).
}} |
Export-Csv vm - videoram.csv - NoTypeInformation - UseCulture
-
Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him. Thank you very much
Hey ihorl18351266,
Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.
Kind regards
Ana Maria
-
Need help to export results to csv format script
Hi guys,.
Need help, export results to csv can someone help me. Thank you.
Connect-VIServer test
$cluster = 'test '.
$clustername = get-cluster $cluster
$Clusters = get-View - ViewType ComputeResource |? Name - as $clustername.name
$Clusters | % {
$Cluste = $_
$VMHostsView = $null
$VMHostsView = get-view $Cluste.Host - name, Hardware Config, property
$VMss = $clustername | Get - VM
$HostCount = ($VMHostsView |) Measure - Object). County
$VMCount = 0 + ($VMss |) Measure - Object). County
$VMsPerHost = [math]: round (($VMCount/$HostCount), 1).
$vCPU = 0 + ($VMss: measure-object-sum - NumCPU property). Sum
$allocatedram = 0 + ($VMss: measure-object-sum - memorygb property). Sum
$avgrampervm = [math]: round (($allocatedram/$VMCount), 1).
$pCPUSocket = ($VMHostsView | % {$_.}) Hardware.CPUInfo.NumCpuPackages} | Measure - Object - sum). Sum
$TpCPUSocket += $pCPUSocket
$pCPUCore = ($VMHostsView | % {$_.}) Hardware.CPUInfo.NumCpuCores} | Measure - Object - sum). Sum
$vCPUPerpCPUCore = [math]: round (($vCPU/$pCPUCore), 1).
$onenode = [math]: tour ((Get-Cluster $cluster |)) Get-VMHost | Select - 1 first | (measure - object - property memorytotalGB-sum) .sum)
$twonode = [math]: tour ((Get-Cluster $cluster |)) Get-VMHost | Select - first 2 | (measure - object - property memorytotalGB-sum) .sum)
$onenodepcpucores = [math]: tour ((Get-Cluster $cluster |)) Get-VMHost | Select - 1 first | (measure - object - property numcpu-sum) .sum)
$twonodepcpucores = [math]: tour ((Get-Cluster $cluster |)) Get-VMHost | Select - first 2 | (measure - object - property numcpu-sum) .sum)
$totalclusterpcores_failover1 = $pcpucore - $onenodepcpucores
$totalclusterpcores_failover2 = $pcpucore - $twonodepcpucores
$TotalClusterRAMGB = [math]: tour ((Get-cluster $cluster | get-vmhost | % {$_} | mesure-objet-propriété memorytotalGB-somme) .sum)
$TotalClusterRAMFailoverOne = [math]: round (($TotalClusterRAMGB-$onenode))
$TotalClusterRAMFailvoerTwo = [math]: round (($TotalClusterRAMGB-$twonode))
$TotalClusterRAMusageGB = [math]: tour ((Get-cluster $cluster | get-vmhost | % {$_} | mesure-objet-propriété memoryusageGB-somme) .sum)
$TotalClusterRAMUsagePercent = [math]: round (($TotalClusterRAMusageGB/$TotalClusterRAMGB) * 100)
$TotalClusterRAMFreeGB = [math]: round (($TotalClusterRAMGB - $TotalClusterRAMUsageGB))
$TotalClusterRAMReservedGB = [math]: round (($TotalClusterRAMGB/100) * 15)
$TotalClusterRAMAvailable = [math]: round (($TotalClusterRAMFreeGB - $TotalClusterRAMReservedGB))
$TotalClusterRAMAvailable_FailoverOne = [math]: round (($TotalClusterRAMAvailable-$onenode))
$TotalClusterRAMAvailable_failoverTwo = [math]: round (($TotalClusterRAMAvailable-$twonode))
$TotalClustervcpuperpcore_FailoverOne = [math]: round (($vCPU/$totalclusterpcores_failover1), 2)
$TotalClustervcpuperpcore_failoverTwo = [math]: round (($vCPU/$totalclusterpcores_failover2), 2)
$newvmcount = [math]: round (($TotalClusterRAMAvailable/$avgrampervm))
$newvmcount_failover1 = [math]: round (($TotalClusterRAMAvailable_failoverone/$avgrampervm))
$newvmcount_failover2 = [math]: round (($TotalClusterRAMAvailable_failovertwo/$avgrampervm))
$afternewvmvcpu1 = $vcpu + $newvmcount
$afternewvmvcpu2 = $afternewvmvcpu1 + $newvmcount
$new1vcpupcpuratio = [math]: round (($afternewvmvcpu1/$pCPUCore), 1).
$new2vcpupcpuratio = [math]: round (($afternewvmvcpu2/$pCPUCore), 1).
New-Object PSObject |
Add-Member-pass NoteProperty 'NOMCLUSTER' $clustername.name |
Add-Member-pass NoteProperty 'TotalClusterHostCount' $HostCount |
Add-Member-pass NoteProperty 'TotalClusterVMCount' $VMCount |
Add-Member-pass NoteProperty "of AverageVM / Host" $VMsPerHost |
Add-Member-pass NoteProperty 'TotalClusterpCPUSocket' $TpCPUSocket |
Add-Member-pass NoteProperty 'TotalClusterpCPUCore' $pCPUCore |
Add-Member-pass NoteProperty 'TotalClustervCPUCount' $VCPU |
Add-Member-pass NoteProperty ' TotalClustervCPU/pCPUCore' $vcpuperpcpucore |
Add-Member-pass NoteProperty "TotalClustervCPU/pCPUCore after 1 failover" $TotalClustervcpuperpcore_FailoverOne |
Add-Member-pass NoteProperty ' TotalClustervCPU/pCPUCore after Failvoer 2' $TotalClustervcpuperpcore_Failovertwo |
Add-Member-pass NoteProperty 'TotalClusterRAMGB' $TotalClusterRAMGB |
Add-Member-pass NoteProperty 'TotalClusterRAMGB_Failover1' $TotalClusterRAMFailoverOne |
Add-Member-pass NoteProperty 'TotalClusterRAMGB_failover2' $TotalClusterRAMFailvoerTwo |
Add-Member-pass NoteProperty 'TotalClusterRAMUSAGEPercent' $TotalClusterRAMUsagePercent |
Add-Member-pass NoteProperty 'TotalClusterRAMUsageGB' $TotalClusterRAMusageGB |
Add-Member-pass NoteProperty 'TotalClusterRAMFreeGB' $TotalClusterRAMfreeGB |
Add-Member-pass NoteProperty 'TotalClusterRAMReservedGB(15%) '. "$TotalClusterRAMReservedGB |
Add-Member-pass NoteProperty 'RAM available for NEW virtual machines in GB' $TotalClusterRAMAvailable |
Add-Member-pass NoteProperty 'RAM available for NEW virtual machines in GB after 1 failover' $TotalClusterRAMAvailable_FailoverOne |
Add-Member-pass NoteProperty 'RAM available for NEW virtual machines in GB after failover 2' $TotalClusterRAMAvailable_FailoverTwo |
Add-Member-pass NoteProperty 'Allocated RAM by virtual computer on an average' $avgrampervm |
Add-Member-pass NoteProperty 'NEW virtual machines that can be configured based on the average of RAM virtual computer' $newvmcount |
Add-Member-pass NoteProperty 'NEW virtual machines that can be configured based on the average of RAM virtual computer after 1 failover' $newvmcount_failover1 |
Add-Member-pass NoteProperty 'NEW virtual machine that can be provisioned littleboy average RAM per virtual computer after failover 2' $newvmcount_failover2 |
Add-Member-pass NoteProperty "vCPU/pCore ratio after new VM provisioning with 1vcpu" $new1vcpupcpuratio |
Add-Member-pass NoteProperty ' vCPU/pCore ratio after new VM provisioning with 2vcpu' $new2vcpupcpuratio
}
Get-cluster $cluster | Get-vmhost | % {
$vmhost = $_
$VMHostView = $VMHost | Get-View
$VMHostModel = ($VMHostsView | % {$_.}) Hardware.SystemInfo} | Model object-group | Sort - down County | Select - 1 first). Name
$VMs = $VMHost | Get - VM #|? { $_. PowerState - eq "Receptor"}
$TotalRAMGB = [math]: round ($vmhost. MemoryTotalGB)
$TotalRAMUsageGB = [math]: round ($vmhost. MemoryUsageGB)
$TotalRAMfreeGB = [math]: round ($TotalRAMGB - $TotalRAMUsageGB)
$PercRAMUsed = [math]: round (($TotalRAMUsageGB/$TotalRAMGB) * 100)
$TotalRAMReservedFree = [math]: round (($TotalRAMGB/100) * 15)
$TotalRAMAvailable = [math]: round (($TotalRAMfreegb-$totalramreservedfree))
New-Object PSObject |
Add-Member-pass NoteProperty 'VMhost' $vmhost. Name |
Add-Member-pass NoteProperty model $vmhostmodel |
Add-Member-pass NoteProperty Sockets $VMHostView.Hardware.cpuinfo.NumCPUPackages |
Add-Member-pass NoteProperty Cores $VMHostView.Hardware.cpuinfo.NumCPUCores |
Add-Member-pass NoteProperty son $VMHostView.Hardware.cpuinfo.NumCPUThreads |
Add-Member-pass NoteProperty VMCount (($VMs | mesure-objet).) County) |
Add-Member-pass NoteProperty vCPU (0 + ($VMs: measure-object-NumCPU of the sum).) Sum).
Add-Member-pass NoteProperty vCPUperCore ((0 + ($VMs | mesure-objet-NumCPU de la somme).)) Sum)/$VMHostView.hardware.cpuinfo.NumCPUCores) |
Add-Member-pass NoteProperty 'RAMGB' $TotalRAMGB |
Add-Member-pass NoteProperty 'RAMUsageGB' $totalramusageGB |
Add-Member-pass NoteProperty 'RAMFreeGB' $totalramfreeGB |
Add-Member-pass NoteProperty 'RAMUsage %' $PercRAMused |
Add-Member-pass NoteProperty 'RAMReservedGB(15%) '. "$totalramreservedfree |
Add-Member-pass NoteProperty 'RAM available for NEW virtual machines in GB' $totalramavailable
}| Sort VMhost | FT-auto * | Out-String-width 1024
See the attached script
-
Bike via script of paragraph styles - need help
Hello
I have a large document (potentially 3000 pages), on each page is a picture of a picture frame and inside each image is a famous quote. I need to type in each quote so I have 10 configuration value different paragraph styles in a different font. I need a script that applies "QuoteStyle1" the text on the first page, "QuoteStyle2" on the next page, etc., and once that 'QuoteStyle10' has been applied the script performs a loop and continues to scroll through the styles apply a style that is different on each page, until it reaches the end of the document.
I got a start on the script (see image), but I think the problem is the line 11 - I want to run the script without having to select anything.
Some additional info that may or may not be of use - all quotes are drawn from a data merge. There is also a name and a color from the data merge. The background on each frame is a different color and that is created with the a very large 'rule below' in a number of other paragraph styles. They are applied with a 'Find & ReplacebyList' i.e. find replace 'Red' with the paragraph style "ColourRed. In the script, I tried to ignore these "color" paragraph styles (lines 2-9) is only the 'quote' styles that the effects of the script.
Any help getting this race would be more useful.
First of all congratulations for the very creative use of blending modes. I would have never thought about it by myself.
Now, for the script, here are two ways to do it (both enjoy the fact that you use a paragraph style BaseQuote):
(1) use a grep search:
var doc=app.activeDocument; var baseQ=doc.paragraphStyles.item('BaseQuoteStyle'); var switchToStyles=[ 'QuoteStyle1', 'QuoteStyle2', 'QuoteStyle3', 'QuoteStyle4', 'QuoteStyle5', 'QuoteStyle6', 'QuoteStyle7', 'QuoteStyle8', 'QuoteStyle9', 'QuoteStyle10']; var l=switchToStyles.length; app.findGrepPreferences=app.findChangeGrepOptions=null; app.findGrepPreferences.appliedParagraphStyle=baseQ; app.findChangeGrepOptions.includeMasterPages=false; var quotes=doc.findGrep(); for (var i=0; i
(2) scroll all managers of related texts:
var doc=app.activeDocument; var baseQ=doc.paragraphStyles.item('BaseQuoteStyle'); var pags=doc.pages.everyItem().getElements(); var switchToStyles=[ 'QuoteStyle1', 'QuoteStyle2', 'QuoteStyle3', 'QuoteStyle4', 'QuoteStyle5', 'QuoteStyle6', 'QuoteStyle7', 'QuoteStyle8', 'QuoteStyle9', 'QuoteStyle10']; var l=switchToStyles.length; for (var p=0;p
-
Need help with a script (o - o8) *, see the Virgin if there is no
Hi all what I need help with a script I can't find an example.
I'm trying to subtract 2 numbers and then multiply this product. (o o8) * one but I just want to do the calculations if all fields have the numbers IE field o, o8 of field and field one.
Thank you in advance. I was stuck on this days searching the Internet.
Assuming you want to affect the outcome of this calculation in another text field, use this code as a custom field calculation script:
var o = this.getField("o").valueAsString; var o8 = this.getField("o8").valueAsString; var a = this.getField("a").valueAsString; if (o!="" && o8!="" && a!="") event.value = (Number(o)-Number(o8))*Number(a); else event.value = "";
-
Need help to modify the findchangebylist.jsx script
I alternate the same script vbs to meet my needs and I was happy about it (likeChild when you give him his favorite toy) but I run into som problems with when I copy and place the script vbs on another computer I want to using it called CS6 instead of CC... I tried everything I could think of but no luck... same thing happens whenever I try to use CS6 open rather CC in which I run it... on the computer I write the script running like charm (on both computers, I have CS6 and CC)... so I decided to use the same script jsx version...
then, when I try this script:
1. the dialog box opens only when my cursor is textframe allowing me to select what I want to change the selected item 2. 1 document. 3 selection
2. when I select 2 blocks of text and document I have 3 or more, the script does not change in 2 pictures selected instead she does in all settings
I need to rotate this script
When I select the text block to open dialogbox allow me to take 2/3 of the options mentioned above, the number 2 and 3
He doesn't find it and change only in blocks of text I selected (when it is selected with the Selection tool) not in all settings
I tried to do it my self, but a little short of knowledge im
I tried to switch the dialog case is open, adding the line case 'TextFrame': in this part of the script
If (app.documents.length > 0) {}
If (app.selection.length > 0) {}
{Switch(App.Selection[0].constructor.) Name)}
case 'PointInsertion ':
'character ': case
case "word":
case 'TextStyleRange ':
case "line":
stops of the "Point":
case "TextColumn":
case 'text ':
case "cell":
case "column":
case 'Row ':
case 'Table ':
myDisplayDialog();
and it works to call the dialog box when the text block is selected, but then he didn't make changes textframe don't debut not overall selected...
So I tried to experiment with this line
if(myResult == true) {}
{Switch (myRangeButtons.selectedButton)}
case 0:
myObject = app.documents.item (0);
break;
case 1:
MyObject = app.selection [0] .parentStory;
break;
case 2:
myObject = app.selection [0];
break;
}
myDialog.destroy ();
myFindChangeByList (myObject);
}
else {}
myDialog.destroy ();
}
by changing the number 1, 2 or 3, but that only the script says that if I have 2 block of selected text to search in the second block of text (incase of number 1) or if I have selected 3 and if numer 2 only script in text 3
I need help please
Hello
I ment something like this:
//... var myResult = myDialog.show(); if(myResult == true){ switch(myRangeButtons.selectedButton){ case 0: myObject = app.documents.item(0); myFindChangeByList(myObject); break; case 1: if (app.selection[0].constructor.name == "TextFrame") for (var b = 0; b < app.selection.length; b++) { myObject = app.selection[b].parentStory; myFindChangeByList(myObject); } else { myObject = app.selection[0].parentStory; myFindChangeByList(myObject); } break; case 2: myObject = app.selection[0]; myFindChangeByList(myObject); break; } myDialog.destroy(); } else { myDialog.destroy(); } //...
App.Selection is a table, but its length is always a number.
If the 1st element of selection is a TextFrame (or more) ==>, we get into a loop
on the other ==> we call a function that had been initially.
Jarek
-
Need help to modify the Script to find the number of vCPU and reservation of memory in VC
Hello
Need help to modify the script so that his can person report to the vc all focus level instead of each level of the Cluster.
Thank you
KR
Try this instead:
$vmsInfo = Get-VM #Creating array to place new object $reportdata = @() Foreach ($vm in $vmsInfo) { #Creating new object $vmInfo = "" | Select Name, CPUReservationMHz, MemoryReservationGB $vmInfo.Name = $vm.Name $vmInfo.CPUReservationMHz = $vm.ExtensionData.ResourceConfig.CpuAllocation.Reservation $vmInfo.MemoryReservationGB = $vm.ExtensionData.ResourceConfig.MemoryAllocation.Reservation / 1024; #Inserting data into new object. $reportdata += $vminfo } $reportdata
-
Need help with some cluster power shell scripts
Guys,
I need help with 2 scripts.
Text 1.
I need a power shell script that will get all the virtual machine in a specific cluster. Virtual machine names as well as the number of processors, output allocated RAM and size of CSV file.
Text 2.
I need a script that will get all data warehouses in a specific cluster and store name data as well as the amounf of free space for a CSV output.
Thanks in advance guys.
Greetings, @peter79 -.
For the first part:
Get-Cluster myClusterName | Get-VM | Select-Object Name, MemoryMB, NumCpu | Export-Csv -NoTypeInformation c:\temp\myVMInfo.csv
And for the second, how about:
Get-Cluster myClusterName | Get-VMHost | Get-Random | Get-Datastore | Select-Object name, FreeSpaceMB, CapacityMB | Export-Csv -NoTypeInformation c:\temp\myDaterstoreInfo.csv
The first would be quite a bit faster by using Get - view instead of Get - VM. It would be like:
## get an array of VM View objects with just the desired/needed properties $arrVMViews = Get-View -ViewType VirtualMachine -SearchRoot (Get-Cluster myClusterName).MoRef -Property Config.Hardware,Name ## make the two filters for displaying the desired info $hshCPUCountFilter = @{n="NumCPUs"; e={$_.Config.Hardware.NumCPU}} $hshMemAmtFilter = @{n="MemoryMB"; e={$_.Config.Hardware.MemoryMB}} ## display the info, and export to CSV $arrVMViews | Select-Object name, $hshCPUCountFilter, $hshMemAmtFilter | Export-Csv -NoTypeInformation c:\temp\myVMInfo.csv
Enjoy.
Maybe you are looking for
-
I want to keep a file photo on a memory stick of 512 GB so it will be portable. Will be my Macbook Pro 2013 be able to withstand a stick of this capability, please? Thank you
-
Can I use second HDD on my Satellite P300-PSPCCE?
Hi all I have a German P300-PSPCCE bought a few months ago. I noticed that the laptop has two bays for 2.5 "sata DISKS, which one is already ocupied by the drive by default, and the other has some ankles plastic on the portable drive door, which make
-
When I'm on a call and I get a txt I can hear the ringtone... while I am speaking... What can I do?
-
How to change the setting on my pc so that it requires no password information when the pc is not used for 10 to 15 minutes?
-
Memory not allocated on the secondary HARD drive
Hello! I installed Win7 Ultimate 64-bit OEM System Builder on a laptop MSI and installed all the recommended my MSI drivers, as well as all Windows updates. However, the thing is, I installed Windows on the 128 GB SSD because MSI advised me and now I