Help with 2 simple scripts

I am looking for 2 very simple scripts, we're for a specific cluster 1, I want to list all the VMS that have 4 GB of memory or more.

Then a 2nd script for a specific cluster1, want to list VM which do not have the VM tools installed or are out of date and select the name, the tool vmware status and memory.

Can someone help please

Here is a line that I tried on a single host... and must work if you connect on a VC as well... people it will list all virtual machines with more than 4 GB of memory:

Get - VM | Where-Object {$_.} MemoryMB - gt 4096}

If you want just the name and memory, then:

Get - VM | Where-Object {$_.} MemoryMB - gt 4096} | Select Name, MemoryMB

For the other for the VMtools...

Get-VM | Get-View | Select-Object @{N="Name";E={$_.Name}},@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}

Concerning

Tags: VMware

Similar Questions

  • help with a simple script

    We do a manual Dr, and after disabling the replication process and presents the LUN DR ESX server and run a powershell script to save virtual machines, we want to turn on all with the script below.

    It works, but I get 'this VM was copied or moved to issue a' for each I answer "moved" to. Any ideas on how to remove or to answer this question in an automated way?

    $sourceVI = Read-Host "vCenter name.
    $creds = get-credential
    to connect-viserver-Server $sourceVI - Credential $creds
    Import-Csv g:\dr\epicdrstartserverlist.csv | Foreach {Get - VM $_.} Name | {Start-vm-confirm: $false}
    Disconnect-VIServer $sourceVI - confirm: $False
    (the CSV file is just a list of the names of virtual machine I want to turn on).

    You can check the presence of an issue with the cmdlet Get-VMQuestion het and reply with the Set-VMQuestion cmdlet.

  • Total newbie looking for help with a simple script

    Hi people,

    I'm totally new to Flash. I created a simple presentation that has 3 buttons invisible.
    By releasing the button 1 the chronology goes to the framework 5 and poster image 5. Button 2 = 10 frame and key 3 = frame 15. It works very well in author mode, but when I publish (flash 7) it does nothing, IE it has just on frame 1

    the script that I have attached to the buttons is as follows (AS2)

    on (release) {}
    f_btn.onRelease = function() {}
    gotoAndStop (5);
    };
    }

    Set thanks

    Please ignore this message

  • Help with the Powershell script to collect logs from all domain controllers

    I am writing a script to retrieve the last 5 days of application, security and log files from all domain controllers. The script runs, but fire the logs from the local server only. The variable $Computer has all of my DC so it's the fine mark. I guess it's a problem with my line ForEach-Object, but is not error. See the below script.

    $log = 'application '.
    $date = get-date-format MM-DD-YYYY
    $now = get-date
    $subtractDays = new-object System.TimeSpan 5,0,0,0,0
    $then = $Now.Subtract ($subtractDays)
    $Computers = get-ADDomainController-filter *.
    ForEach-Object - InputObject $Computers - process {Get-EventLog - LogName $log - after $then - before $now - EntryType error | select EventID, MachineName, Message, Source, TimeGenerated |} ConvertTo-html | {Out-file $env:TEMP\Applicationlog.htm}
    Invoke-Expression $env:TEMP\Applicationlog.htm

    Thank you

    Rich

    Hello

    To help with the repost the question script to the script Center Forum

    http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home

  • Need help with a simple basketball game.

    Hi im new here and I need help with what makes this simple basketball game.

    Im trying to recreate this this video game. I'm not sure if it uses as2 or as3

    If someone could help me make a game like this or point me to a link on how to do it would be greatly appreciated.

    AS2 is used in the video.  If you have other issues, please post in the forum AS1/AS2.

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

    VmNameDayMemAllocMemMaxMemAvgMemMin
    < name VM1 >07/05/2016 0:004096181818
    < name VM1 >06/05/2016 0:0040963612

    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 a simple calculation.

    I will apologize to the front. I have no knowledge of writing Javascripts. I can use them if someone writes to me, but that's all. I created a simple form with money dealing. I have boxes of different text for the user to enter a number based on what type of coin it is.Currency.jpg

    In the left column, they will enter a number. I would like for the right column counting from that. However, the quantity of money (ie. 100, 50, 20, etc.) is not a text field. It is simply the text entered in another program. I'm looking for is a way to do this without having to do the amounts in currency a text field. Something along the lines of X * 100 is.

    If you can give any help or suggestion, I'd be very happy.

    Thank you.

    You will have to hard code the quantity of money in the script.

    In the first line, create 2 text, Text1 and Text2 fields. Use what the calculation script personalized to Text2:

    If (this.getField ("Text1") ".value! == ' ') {}
    This.getField("Text1").value = Event.Value * 100;
    }

    Clears Text2 if nothing is in Text1
    else event.value = «»

    The second pair of text fields would be "50" instead of "100" in line 2, etc.

  • Please help with some simple AS2

    Hello

    I have a puzzle that I adapted in AS2. It is perfect for my needs, with one exception. It has a 'Start' button that erases the image of the puzzle, so you can start to assemble. I don't need the 'Start' button and am currently placing the script from the 'Start' button in the timeline, so that the picture of the completed puzzle is automatically cleared, ready to start assembling the four parts. The code original source from headache and Tunis is located here:

    http://www.ActionScript.org/resources/articles/13/1/jigsaw-puzzle/Page1.html

    This is the script that is currently on the button:

    We (Release)

    {

    for (i = 1; i < = n; i ++)

    {

    ["p" + i] this.joined_mc ._visible = false;

    }

    }

    and the button is inside a clip on the main stage.

    Please can someone help me on this point - would be really grateful!

    Thank you

    Ed.

    If it's a simple button (not a movieclip button) and attach the button containing the chronology:

    for (i = 1; i<>

    {

    ["P" + i] this.joined_mc ._visible = false;

    }

  • help with pl SQL script

    Hello everyone.

    Can sb help me create the following script, based on three tables:

    ID col1
    314value2

    ID ID1 col2
    3141somevalue4
    3142somevalue5
    3143somevalue6
    ID
    ID1
    ID2
    COD
    Qty.

    31411LTR1031412KG2031421LTR40

    The result should be like this:

    id id1
    ID2
    cod_1
    qty_1
    COD2
    qty_2
    col1
    col2
    31411LTR10KG20value2somevalue4
    31421LTR40value2somevalue5

    Post edited by: 933651

    Hello

    Here is my view on this problem. May need some adjustments in the join conditions when the data model and the data is more clear

    create table t1 (
      id number,
      col1 varchar2(10)
    );
    insert into t1 values (314, 'somevalue2');
    create table t2 (
      id number,
      id1 number,
      col2 varchar2(10)
    );
    insert into t2 values (314, 1, 'somevalue4');
    insert into t2 values (314, 2, 'somevalue5');
    insert into t2 values (314, 3, 'somevalue6');
    create table t3(
        id  number,
        id1 number,
        id2 number,
        cod varchar2(3),
        qty number
    );
    insert into t3 values (314, 1, 1, 'LTR', 10);
    insert into t3 values (314, 1, 2, 'KG', 20);
    insert into t3 values (314, 2, 1, 'LTR', 40);
    
    with ltr as (
      select id, id1, id2, cod, qty  from
      (
        select id, id1, id2, cod as code, cod, qty from t3
      )
      pivot
      (
        sum(qty) for code in ('LTR' as qty)
      )
      where qty is not null
    ), kg as (
      select id, id1, id2, cod, qty  from
      (
        select id, id1, id2, cod as code, cod, qty from t3
      )
      pivot
      (
        sum(qty) for code in ('KG' as qty)
      )
      where qty is not null
    )
    select
      t2.id,
      t2.id1,
      ltr.id2,
      ltr.cod,
      ltr.qty,
      kg.cod,
      kg.qty,
      t1.col1,
      t2.col2
    from t2 join ltr on (
      t2.id = ltr.id and t2.id1 = ltr.id1
    ) full join kg on (
      t2.id = kg.id and t2.id1 = kg.id1
    ) left join t1 on (
      t1.id = t2.id
    )
    order by id, id1
    ;
    
    drop table t1 purge;
    drop table t2 purge;
    drop table t3 purge;
    
    table T1 created.
    1 rows inserted.
    table T2 created.
    1 rows inserted.
    1 rows inserted.
    1 rows inserted.
    table T3 created.
    1 rows inserted.
    1 rows inserted.
    1 rows inserted.
    
            ID        ID1        ID2 COD        QTY COD        QTY COL1       COL2
    ---------- ---------- ---------- --- ---------- --- ---------- ---------- ----------
           314          1          1 LTR         10 KG          20 somevalue2 somevalue4
           314          2          1 LTR         40                somevalue2 somevalue5
    
    table T1 dropped.
    table T2 dropped.
    table T3 dropped.
    
  • Please help with installing simple label

    Hi guys,.
    I know that it will be simple for most of you. Used good ol PageMaker ' years. Has started with the ID of a couple of years, but have not made a lot with it. Now have CS6 and I wanted to address labels [Avery 5160 - 30 labels/page]. I remember this question once before w/CS3 and people said I had need of a later version that would allow me to 'merge' repeated on the page of the label without having to duplicate the text and graphics 30 times.
    Could someone give me the specific steps to follow to do this? It's all there in the original label of text and graphics. How I can repeat this 29 times without going through the bureaucracy to fool the text & chart [I did ].
    What I did was, group the text and graphic, it fool 2 times in a row, then fool the line again and again until the page was filled with 30 labels.
    Yes, I know I am a fool, and in "pain repetition" but having been a member of Adobe forums since the 90's I LOVE FORUMS! We all have helped so much. And that's where I get my answers.
    Thanks in advance,
    Ellen

    Printing labels on a personal printer can be a little tricky because the paper is sucked in most home printers, there is a bit of drift. What I mean is that if you print multiple copies of something in a paper stock that had graphic top brands, you will see that you cannot ensure that each sheet is printed in exactly the same position. For this reason, you'd better not try to print too close on the edges of each label. What I recommend is that you set up 30 text blocks and them all together in the string or use the fusion of data to set up your labels, you apply a line of half a percentage point for executives, print a map and see how close frames line up with the edges of your labels. You need to maybe move the Group of labels to the top, bottom, left, or right to bring it in the stadium, but once you set for your printer, you can take off the lines and define a quantity of text box so that if they drift a little, none will be cut off.

    Also, when you ask about it, you can select a single object or group and go to Edit > step and repeat and check the boxes create as a grid and Preview to 30 labels off alone and see how they will lay in the page. Just put your horizontal and vertical offset to the size of your label.

    Is that help, or do you need instructions on how to do a data merge?

  • I need help with my first Script in AE CS5

    Hello fellow designers out there.

    I'm newbie on AE Scripting here. I run my CS 5 on Win 7. I'm trying to create a simple solid GUI and it controls opacity by cursor. I fail and do not now how it work. Here is the code that I have written in reference to many sources and tutorials:

    myComp = app.project.item (1); akses comp 1

    mySolid = myComp.layers.addSolid ([1.0,1.0,0], 'my place', 50, 50, 1); solid

    var myWin = new window ("palette", "Transform", undefined); create the palette

    myWin.orientation = "row";

    var myOpacity = myWin.add ('Committee', undefined, "Strong opacity");

    myOpacity.orientation = "column";

    myOpacity.add ("statictext", undefined, "Opacity Kontrol");

    var opacitysliderCtrl = myOpacity.add ("slider", undefined, 50, 0, 100); make cursor

    var layerOpacity = mySolid.property ("opacity");

    opacitysliderCtrl.onChanging = function()

    {

    var val = Math.round (opacitysliderCtrl.value);

    layerOpacity.value = val;

    };

    myWin.center ();

    myWin.show ();

    Please, help me to see the problem here. Thank you

    There is more harm than good in your work

    At the moment you script attached a slider to a single layer (mySolid, that you add at the beginning).

    This is not very useful, that you cannot use this slider for the other layers.

    You should also keep in mind that this solid can be deleted, so the mySolid object may become invalid (referring to a solid that no longer exists).

    I don't know what, exactly, is your plan, but a script has generally not set anything related to AE in his many body (at launch).

    Only when the user clicks/change a widget script tries to extract a model, layer, property, or anything that the user specified by "a kind of secret code" (most of the time: the model, property, layer, etc. is selected).

    If you want the slider to control the opacity value of all selected layers in the active model, it would be something like this:

    var myWin = new Window("palette", "Transform", undefined); //create pallete
    myWin.orientation = "row";
    
    var myOpacity = myWin.add("panel", undefined, "Solid Opacity");
    myOpacity.orientation = "column";
    
    myOpacity.add("statictext", undefined, "Kontrol Opacity");
    
    var opacitysliderCtrl = myOpacity.add("slider", undefined, 50, 0, 100);//make slider
    opacitysliderCtrl.onChanging = function onOpacitySliderChanging(){
    
            // retrieve the AE things that have to be handled: in this case, all selected layers in the active comp
            var myComp, myLayer, n;
            var layerOpacity, val;
    
            myComp = app.project.activeItem;
            if (myComp.numLayers>0){
                for (n=0; n
    

    Xavier

  • Need help with the Simple Question of coding (substring or charAt())

    Hello

    I have what I believe to be a simple matter of coding I was hoping that someone could help answer. I know how to do a decent amount of things but I'm pretty new to Livecycle and trying to change one of our PDF files so that if a certain field has a number starting with number 6 a certain button will become visible. I already have a set of code which is to control the visibility of this button, but I wanted to add this clause. Can someone help me to do this?

    Here are the existing code:

    If ((QuestionsPage2.COIQuestions.COIYN.rawValue == "1" & &))

    QuestionsPage2.EmailButtons.NSFCheck.rawValue == '1') & &

    (QuestionsPage2.ManagerSignature.ManagerDate.rawValue! = null & &)

    QuestionsPage2.ManagerSignature.ManagerCheckBox.rawValue! = null & &

    QuestionsPage2.ManagerSignature.ManagerSignature.rawValue! (= null))

    {

    QuestionsPage2.PasswordSection.RiskPassword.presence = "visible";

    QuestionsPage2.PasswordSection.PurchUseOnly.presence = "visible";

    QuestionsPage2.PasswordSection.HRPassword.presence = "visible";

    QuestionsPage2.EmailButtons.EmailContractsAndRisk.presence = "visible";

    }

    I would like to add at the top to look at the specific area of the first character to see if it is a 6 or not. Here's what I tried to do, but it did not work.

    If ((QuestionsPage2.COIQuestions.COIYN.rawValue == "1" & &))

    QuestionsPage2.EmailButtons.NSFCheck.rawValue == '1' & &

    ContractInfo.AgreementDetails.Org.substring (0.1)! = '6' )

    The type of field, that I'm looking is a field "Digital field" 4 characters.

    Can someone help me fix my code to make it work?

    Thank you!!

    you don't need to make such a work autour, everything you did not notice, this is NumericField isn't a string is always a numeric (number)

    If you can use substring on a whole or decimal number... unless it's a chain... then use the toString() after the .rawValue like this

    ContractInfo.AgreementDetails.Org. rawValue.toString (). Substring (0.1)! = « 6 »

    It should work.

  • help with a simple user interface for video flv with benchmarks AND buttons

    Hi all

    OK, I built a very simple FlashDrive using the componet video and I used in the flv file cue points, then I used simple buttons and findcuepoints code snipets for make my buttons go to a certain part of the movie.

    Everything works very well.

    Now what I do is when a certain amount of point play button stay an overstate and once made part of the video or another button is clicked on the first North of the State and the new part back button or the new button have the overstate.

    I think it will be an easy task, I'm not sure how to in this regard.

    Any help greatly appricaited.

    code below

    start_btn.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint);
    
    function fl_ClickToSeekToCuePoint(event:MouseEvent):void
    {
        var cuePointInstance:Object = vid.findCuePoint("ch1");
        vid.seek(cuePointInstance.time);
    }
    
    
    ch2_btn.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint_1);
    
    function fl_ClickToSeekToCuePoint_1(event:MouseEvent):void
    {
        var cuePointInstance:Object = vid.findCuePoint("ch2");
        vid.seek(cuePointInstance.time);
    
    }
    
    ch3_btn.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint_2);
    
    function fl_ClickToSeekToCuePoint_2(event:MouseEvent):void
    {
        var cuePointInstance:Object = vid.findCuePoint("ch3");
        vid.seek(cuePointInstance.time);
    }
    
    ch4_btn.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint_3);
    
    function fl_ClickToSeekToCuePoint_3(event:MouseEvent):void
    {
        var cuePointInstance:Object = vid.findCuePoint("ch4");
        vid.seek(cuePointInstance.time);
    }
    
    ch5_btn.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint_4);
    
    function fl_ClickToSeekToCuePoint_4(event:MouseEvent):void
    {
        var cuePointInstance:Object = vid.findCuePoint("ch5");
        vid.seek(cuePointInstance.time);
    }
    
    ch6_btn.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint_5);
    
    function fl_ClickToSeekToCuePoint_5(event:MouseEvent):void
    {
        var cuePointInstance:Object = vid.findCuePoint("ch6");
        vid.seek(cuePointInstance.time);
    }
    

    I try to help, but you will need to apply your neurons to make it work with what I have already explained (three times with what I propose below).  Try something like the following (I'm rename your buttons for ch1, ch2, ch3, ch4, ch5 and ch6 so that the same functions can be shared by all the buttons...)

    This affects the listeners to all 6 buttons

    for (var i: uint = 1; i<7;>

    This ["ch" + String (i)] .addEventListener (MouseEvent.CLICK, fl_ClickToSeekToCuePoint);

    }

    It deals with one of the 6 inclinometer when they are clicked

    function fl_ClickToSeekToCuePoint_1(event:MouseEvent):void

    {

    BTN var = event.currentTarget;

    var cuePointInstance:Object = vid.findCuePoint (btn.name);

    VID. Seek (cuePointInstance.Time);

    resetButtons();    What makes all the buttons back to normal

    btn.upState = btn.overState; What makes the States of change of the button clicked

    }

    function resetButtons (): void {}

    for (var i: uint = 1; i<7;>

    This ["ch" + String (i)] .upState = this ["ch" + String (i)] .hitTestState;

    }

    }

    To do this, your buttons need to have the same work as part of hit as they do under the top.

  • Need help with files combining script

    Hey guys, I'm a graphic designer who is really hoping most commonly the code can someone help! I have several hundred images that need to be combined. A client gave me a folder of images and their alpha cards as separate files. I need combine each image and alpha map and export the new image format PNG 24 with transparency. Doing so by hand will take forever, do this with a script is going to be awesome. The script must:

    -Open Filename.png

    -Create a duplicate of the background layer (as background layers may not have masks it seems)

    -Remove the background layer

    -Add a layer mask to the new double layer

    -Open filenamea.png (the alpha cards follow convention assignment of names + a .png file name)

    -Copy filenamea.png into the layer mask to filename.png

    -Save the filename.png for Web and devices such as a PNG 24 with transparency in a folder called converted (to avoid overwriting the old image)

    I'm sure it's more complicated, it seems, but is - someone up to help a poor, illiterate code GD?

    Here's a JavaScript solution only, for the curious. Save it as MergeAlpha.jsx and run it from Photoshop.

    X

    function cTID(s) { return app.charIDToTypeID(s); };
    function sTID(s) { return app.stringIDToTypeID(s); };
    
    function main() {
    
      var folder = Folder.selectDialog();
      if (!folder) {
        return;
      }
    
      var ofolder = new Folder(folder + "/Converted");
      ofolder.create();
    
      var saveOpts = new ExportOptionsSaveForWeb();
      saveOpts.format = SaveDocumentType.PNG;
      saveOpts.PNG8 = false;
      saveOpts.transparency = true;
    
      var pngs = folder.getFiles('*.png');
    
      for (var i = 0; i < pngs.length; i++) {
        var file = pngs[i];
        var afile = new File(folder + '/' + file.name.replace('.png', 'a.png'));
        if (!afile.exists) {
          continue;
        }
    
        var doc = app.open(file);
        doc.activeLayer.isBackgroundLayer = false;
        var adoc = app.open(afile);
        adoc.selection.selectAll();
        adoc.selection.copy();
        adoc.close(SaveOptions.DONOTSAVECHANGES);
    
        createLayerMask();
        selectMaskChannel();
        doc.paste();
    
        var ofile = new File(ofolder + '/' + file.name);
        ofile.remove();
        doc.exportDocument(ofile, ExportType.SAVEFORWEB, saveOpts);
        doc.close(SaveOptions.DONOTSAVECHANGES);
      }
    };
    function createLayerMask() {
        var desc9 = new ActionDescriptor();
        desc9.putClass( cTID('Nw  '), cTID('Chnl') );
            var ref6 = new ActionReference();
            ref6.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') );
        desc9.putReference( cTID('At  '), ref6 );
        desc9.putEnumerated( cTID('Usng'), cTID('UsrM'), cTID('RvlA') );
        executeAction( cTID('Mk  '), desc9, DialogModes.NO );
    };
    function selectMaskChannel() {
        var desc26 = new ActionDescriptor();
            var ref18 = new ActionReference();
            ref18.putEnumerated( cTID('Chnl'), cTID('Chnl'), cTID('Msk ') );
            ref18.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
        desc26.putReference( cTID('null'), ref18 );
        desc26.putBoolean( cTID('MkVs'), true );
        executeAction( cTID('slct'), desc26, DialogModes.NO );
    };
    
    main();
    
  • Help with a command script

    Hello
    There some time, someone has written the following script for me. The idea was to make a command that would allow me to reduce an image up to 400 width in pixels without loss of scale. I want to have a similar command that will reduce a large image to 400 pilel height without loss of scale. I fiddled with the width command but cannot operate in height. Can I get help the following command to work at height of 400 pixels of rewriting? Thank you.
    User variables
    var width = 400;

    Order
    var dom = fw.getDocumentDOM ();
    var scale = width/dom.width;
    var height = dom.height * scale;
    dom.setDocumentImageSize ({left:dom.left, top: dom.top, right:dom.left + width, bottom:dom.top + height}, {pixelsPerUnit:dom.resolution, United:dom.resolutionUnits});})

    Tom Hersh wrote:
    > I try it this way. But I couldn't make it work. The word "scale" is critical, but I switch did not help.

    Just pass the variables verbatim. Height width and width for
    height.

    User variables
    var width = 400;

    Order
    var dom = fw.getDocumentDOM ();
    var scale = width/dom.width;
    var height = dom.height * scale;
    dom.setDocumentImageSize ({left:dom.left, top: dom.top,
    Right:DOM. Left + Width,
    Bottom:DOM. Top + Height}, {pixelsPerUnit:dom.resolution,
    :DOM.resolutionUnits}) units;

    User variables
    var height = 400;

    Order
    var dom = fw.getDocumentDOM ();
    var scale = height/dom.height;
    var width = dom.width * scale;
    dom.setDocumentImageSize ({left:dom.left, top: dom.top,
    Right:DOM. Left + Width,
    Bottom:DOM. Top + Height}, {pixelsPerUnit:dom.resolution,
    :DOM.resolutionUnits}) units;

    Once you see this script, it is not hard to see what he does.

    This is the script of fireworks generated the scale just at the height of a
    picture 400 px of 640 x 480 px.

    fw.getDocumentDOM)
    .scaleSelection (0.83281248807907104, 0.83333333333333337,
    "autoTrimImages transformAttributes");

    It works on all the images in 640 x 480. Add to that a 700 x 480 and it won't.

    I'm assuming, very few people here (including me), would be able
    to turn this into something that would take into account the widths of
    as did senocular.

    SKB

Maybe you are looking for