Help edit a script

Hello

Almost found a solution to this age-old problem I have. I found a script that records bands like png and it's great, but I need to save as a JPEG instead. I also need to have an option to change the name. In the script is fine even if I liked the "export layers to files" box pops up. They are currently named after the name of the group I want to keep, just to add to. I'm really sorry for my lack of experience when it comes to stuff like that, I know that people have suggested ways to do it, but I do not understand how to edit the script itself and make work.

Thank you much in advance!

#target photoshop

main() {} function

if(!documents.) Length) return;

var doc = activeDocument;

oldPath var = activeDocument.path;

for (var a = 0; a < doc. layerSets.length; a ++) {}

activeDocument.activeLayer = activeDocument.layers.getByName (doc.layerSets [a] .name);

dupLayers();

activeDocument.mergeVisibleLayers ();

activeDocument.trim (TrimType.TRANSPARENT, true, true, true, true);

var saveFile = file (oldPath +"/"+doc.layerSets[a].name + ".png");

SavePNG (saveFile);

app.activeDocument.close (SaveOptions.DONOTSAVECHANGES);

}

}

main();

function dupLayers() {}

var desc143 = new ActionDescriptor();

var ref73 = new ActionReference();

ref73.putClass (charIDToTypeID ('Dcmn'));

desc143.putReference (charIDToTypeID ('null'), ref73);

desc143.putString (charIDToTypeID ('Nm'), activeDocument.activeLayer.name);

var ref74 = new ActionReference();

ref74.putEnumerated (charIDToTypeID ('Lyr'), charIDToTypeID ('Ordn'), charIDToTypeID ('Trgt'));

desc143.putReference (charIDToTypeID ('Usng'), ref74);

executeAction (charIDToTypeID ('Mk'), desc143, DialogModes.NO);

};

function SavePNG (saveFile) {}

var pngOpts = new ExportOptionsSaveForWeb;

pngOpts.format = SaveDocumentType.PNG

pngOpts.PNG8 = false;

pngOpts.transparency = true;

pngOpts.interlaced = false;

pngOpts.quality = 100;

activeDocument.exportDocument (new File (saveFile), ExportType.SAVEFORWEB, pngOpts);

}

It may be useful

#target photoshop
function main(){
    if(!documents.length) return;
    var doc = activeDocument;
    var oldPath = activeDocument.path;
    for(var a=0;a 
         

Tags: Photoshop

Similar Questions

  • Help editing a script

    I found this script somewhere out there that lists of data warehouses, name of virtual machines in the data store and the path of the data store.  I also want to get the note field in the report.  Can someone help?

    $report = @)

    Get - VM | Get-View | % {

    $row = "" | Select the name, the data store, path

    $row. Name = $_. Name

    $row. Data store = (Get-view $_.) Datastore [0]). Summary.Name

    $current = get-view $_. Parent

    $path = $_. Name

    {}

    $parent = $current

    if($parent.) Name - only "vm") {$path = $parent. {Name + "\" + $path}

    $current is get-view $current. Parent

    } While ($current. Parent - no $null)

    $row. Path = $path

    $report += $row

    }

    $report

    Thank you

    Sorry, must have misread your question.

    The Notes field makes even a little simpler.

    Get-VM | % {
         $vmImpl = $_
         $_ | Get-View | % {
              $current = Get-View $_.Parent
              $path = $_.Name
              do {
                   $parent = $current
                   if($parent.Name -ne "vm"){$path = $parent.Name + "\" + $path}
                   $current = Get-View $current.Parent
              } while ($current.Parent -ne $null)
              $row = "" | select Name, Datastore, Path, Note
              $row.Name = $_.Name
              $row.Datastore = (Get-View $_.Datastore[0]).Summary.Name
              $row.Path = $path
              $row.Note = $vmImpl.Description
              $report += $row
         }
    }
    $report
    
  • Helps editing of video clips in imovie

    Have an imported video but trying to edit and cut the clips that I am only able to select the full video to put down in my film, not just the clip I want to choose.  Helps editing of video clips in imovie

    < re-titled by host >

    have an imported video but trying to edit and cut the clips that I am only able to select the full video to put down in my film, not just the clip I want to choose.

    This is a new and improved feature in iMovie. You must hold down the 'R' key while clicking on the part of the item you want.  By default, the full clip will be added to the time line.

    See notes to iMovie version 10.1.2:

  • How to create a box the size of the artboard without the help of a script

    HI -.

    Is there a way to create a box to the size of the artboard automatically, without the help of a script? FOR EXAMPLE. something I can build in action. Ive been able to create the box using a script, but we can not save the script in action, so unfortunately that there's no help for me

    What I want to do is

    1 open the file

    2 create box with no filling, no race, making the size of the box of the artboard

    3. run the rest of an existing action

    Greatly appreciate any help, I want to run on more than 10,000 cases per year.

    Using slices may be slightly inaccurate, Carlos (no offense intended).

    Here is another approach:

    Rectangle_Artboard_Size.AIA - Google Drive

    The action was created in Illustrator CS5, so no guarantee that it works in CC2015.

    Two prerequisites are necessary:

    -Alignment on work plan should be on (pallet alignment).

    -L'option divide and outline will remove unpainted work should be disabled (see Options Pathfinder).

    In older versions of Illustrator (I think of CS3), we could make a simple gesture of the 2 step using the object > acreage > make order, then the cultivated area > Release. It is not possible in recent versions of Illustrator.

  • 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 = "";
    
  • Girls need help with a script to repeat the link to another folder in indesign

    I REALLY hope you smart people can help me.

    We had servers which means that all of our Indesign documents now have a broken link. To manually "re-edit the link to the file" causes Indesign down :-(. And it takes forever I am hoping to find a script that can connect all the links in the doc to a new file structure.

    The name of the link (name of file) and the file structure remains the same; Just point to another server. The structure contains subfolders so the best way would be that the script can see subfolders as well, but otherwise I would gladly use a script that points of 6 subfolders at a time.

    Problem - I KNOW NOT ALL SCRIPTS and I'm a graphic designer so I can't create scripts :-(. I have already had success Googling a script to unlink everything in the document, but I don't know how to run the script. DO NOT to create them.

    ANY help in this forum? I have 6 designers waiting for me to fix this.

    Is there a script where I could just change the path and then he could repeat?

    We have iMac OSX Yosemite 10.10.4

    PLEASE HELP... :-)

    / Dina

    Try this... it is created by Vamitul

    main() {} function

    var doc = app.activeDocument;

    myLinks var = doc.links.everyItem () .getElements ();

    var linkObj = {};

    Create the initial object

    / * {linkObject

    [path] {missingNr,

    arrayOfMissingLinks}

    } */

    for (var i = 0; i)< mylinks.length;="" i++)="">

    If (myLinks [i] .status == LinkStatus.LINK_MISSING) {}

    var myPath = File(myLinks[i].filePath).path.toString ();

    If (linkObj [myPath] == undefined) {}

    linkObj [myPath] = {}

    missingNr: 1.

    missingLinks: [myLinks [i]],.

    newPath: "

    }

    } else {}

    linkObj [myPath] .missingNr ++;

    linkObj [myPath].missingLinks.push (myLinks [i] .getElements () [0]);

    }

    }

    }

    $.writeln (linkObj.toSource ());

    var myDialog = new window ("dialog", "link Chaser:', undefined");

    Panel1 = myDialog.add var ('panel', undefined, "double-click to select the new path '");

    Panel1. Align = ["fill",""];

    myList var = panel1.add ("listBox", undefined, "", {})

    columnWidths: [160, 160, 130],

    numberOfColumns: 3,.

    showHeaders: true,

    columnTitles: ['old road', 'New Path', 'Nr. missing links']

    });

    myList.size = [450, 200];

    myList.align = ["fill",""];

    for {(var missingPath in linkObj)

    with (myList.add ("item", missingPath)) {}

    Subitems [0] .text is linkObj [missingPath] .newPath;.

    Paragraphs [1] .text is linkObj [missingPath] .missingNr;.

    }

    }

    myList.onDoubleClick = function() {}

    var myNewPath = (new folder (app.activeDocument.filePath) .selectDlg ("Select New Folder") |. toString() ' ");

    myList.selection.subItems [0] .text = myNewPath;

    linkObj [myList.selection.text] .newPath = myNewPath;

    }

    myDialog.add ('button', {undefined, "Ok",

    name: 'ok '.

    });

    myDialog.add ("button", undefined, "Cancel", {})

    name: "Cancel".

    });

    If (myDialog.show () == 1) {}

    for (var i in linkObj) {}

    If (linkObj [i] .newPath! = ") {}

    var fixedNr = 0;

    Var links = linkObj [i] .missingLinks

    for (var j = 0; j)< links.length;="" j++)="">

    var queue = newFile (linkObj [i] .newPath + "/" + links [j] .name);

    If {(newFile.exists)

    fixedNr ++;

    Links [j] .relink (NewFile);

    }

    }

    Alert ("in the folder: \n" + linkObj [i] .newPath + '\n' +)

    'Fixed' fixedNr ' links of ' + linkObj [i] .missingNr + '\n ' +.

    "Please check");

    }

    }

    };

    }

    app.doScript ('main()', undefined, undefined, UndoModes.entireScript, "Chaser link");

  • Help creating a script to delete users specific bunch of disconnection

    Hi guys

    I was wondering if you could help me out, I read in the creation of a script that deletes a bunch of disconnected users.

    I find stuff a lot saying that connection/disconnection hooks are now obsolete but they are still functional in El Cap.

    However my question is in what regards the script itself. I was going to create a shell script logout following the advice on this page http://www.amsys.co.uk/2015/02/delete-keychains-logout/?nabe=5737850786545664:0 but I want to make is specific to a single user, I don't want bunch of our normal users to be affected. This script would be attached to our account by Freelance. It would save me time to clear up after that freelancers have used our kit.

    Any advice/help would be very appreciated

    Thank you

    K miles

    Hey there manbearpig349,

    Welcome to the communities of Apple Support!

    For some details added here, looks like you have a computer with multiple user accounts. You want to create / run a script for any one of these user accounts, is - that correct?

    For more details on how the scripts, in the link mentioned above, it would be best to speak directly with the creators to Amsys.

    See you soon

  • Trace channels by name without the help of a script.

    Hello

    I'm looking to draw channels, by using a report model, without having to rely on the index of each channel. I am processing the data from different sources and although they have the same marking convention for certain types of channels, some sources generate unique channels that can shake the index, and I have to manually put the parcels on the right channels.

    Is there a way around this without the use of scripts?

    Thanks for any help.

    Kevin

    I think that you can configure your report models as they reference channels by name, as opposed to the number.

    I have not used but check it out

    
    

    Or try this

    On the report tab, go to settings > Layout Set Up > layout settings and I believe that you change the channel reference it as well

  • Need help on "flushdns" script and 'freeing the INVESTIGATION period' under ipconfig

    Hello, I am fairly new to scripting.  I was wondering if there is a way to create a script in shutdown.exe to clear the dns cache, and then release the INVESTIGATION period, when I stopped the machine.  If anyone can help me with the syntax on how to create it, I would appreciate it.  This is for XP, but I guess it works even under Vista as well

    ~

    Also how can I disable the pop-up window step boring, stupid when I submit a new question or discussion in the forum?  It covers a part of the message body and whenever I click on the ground, it reappears again.

    I don't see any option in the Shutdown.exe to perform one of these tasks, however, I see no reason why you could not create a batch file that is running "Ipconfig/flushdns" to clear the DNS cache, followed by "Ipconfig/Release" to broadcast the DHCP address and finish first by "stop s" to shut down the computer

    HAL
    --
    HAL Hostetler, TCE
    Engineer senior/UPDATED--MS MVP-Print/Imaging - WA7BGX
    www.kvoa.com - KVOA television, Tucson, AZ.
    Live Hot Licks - www.badnewsbluesband.com

  • Help editing Master Slide - objects were staying is not put on film

    Hello

    I'm a little more recent for Captivate in what I have edited and created projects where someone else is developing the model. I am currently developing a model in Captivate 8.01.242 and am really frustrated.

    In my model, I use placeholders for items that I have to change for different slides (for example, images or titles) and for forms using smartshapes I always want to appear. I have a lot of layers on some slides, but once I got them in the right order, I save, switch to the view of the film, and things don't overlay properly! For example, I put an image placeholder in the background, but in the film display, that's on top. Or a placeholder text is hidden in a smart form.

    I tried selecting 'Master drag objects On Top' and shift things, but aren't always in the correct order. Is interesting, if I select, deselect, and reselect this option, slide rearrange the objects each time.

    Any help that can be provided would be great! I searched the forums without success on this issue.

    Thank you!

    Lisa

    I would recommend THAT DO not use Captivate CPTL file format to create the project "templates".

    Out of all the reasons that you mention in your own message, you are not always aware that Captivate currently still has a big bug with models CPTL which means if you set Variables and Actions put forward in your models and use them at all (even in version 9), then when your developers to use your model to spawn the new CPTX project files they will find the variables and advanced actions are duplicated by the exact number of times where they have been used in the model.  In practice, this creates a huge mess that cannot be repaired.

    If you want to see the issue in the action or reproduce it for yourself, here is a post I did on this subject some time ago (there are now three versions of Cp since now):

    Problems of duplication in Adobe Captivate Cp7 Cp8 Templates | Infosemantics Pty Ltd

    My recommendation in the video is that you set up a CPTX you like your 'model' to work and then just set the READ ONLY file properties so that anyone who tries to use this file should save as to save their changes.  This avoids the above bug.

  • Help more necessary scripts please.

    OK the Script below is what I would use for what I do.  I have a lot of things that I'll add to over time so I hope you can help with some of these issues.  I have all the things I want to do marked with / /.  We can only do a section at a time if you want to make the script more easily or all at the same time it doesn't matter to me.  I'm very new script so it might take me some time to do.

    var w = new window ("dialogue {text:"Ongoing changes of execution", orientation: 'column', alignChildren: ['fill ', ' fill'], properties: {closeButton: false}}");

    w.main = w.add (' group {preferredSize: 600 (500) and alignChildren: ['left', 'fill']} "");

    w.stubs = w.main.add ("listbox", undefined, ['changes', 'Check for changes', 'Example']);

    w.stubs.preferredSize.width = 150;  {w.tabGroup = w.main.add ("group {alignment: 'fill '()' fill'}") and orientation: 'stack'} ");"

    w.Tabs = [];

    w.Tabs [0] = w.tabGroup.add ("group");

    w.Tabs [0]. Add ("statictext {text:"change"}");} ")

    w.Tabs = [];

    w.Tabs [0] = w.tabGroup.add ("group");

    w.Tabs [0]. Add ("statictext {text:"Select to make a change"}");

    w.Tabs [0]. Add ("panel");

    w.Tabs [0]. Add ('checkbox {text: 'Change Run running List1'} "") ;// turn on find and replace Script

    ~ IF possible I would like this script to be exicuted if the checkbox above is selected. After pressing the OK button

    ~ I don't want this part of the script to enable if this button is not selected.

    ~ Replace("<CR>", "^p")

    ~ Replace("", "")

    ~ Replace(":", ":")

    ~ Replace(".", ".")

    ~ Replace("^p^p", "^p")

    ~ Replace("<CR>", "^p")

    //~

    //~

    //~

    ~ the function Replace (input, output)

    //~         {

    ~ app.selection [0];

    ~ app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

    ~ app.findTextPreferences.findWhat = entry;

    ~ app.changeTextPreferences.changeTo = output;

    ~ app.activeDocument.changeText ();

    //~

    //~

    w.Tabs [0]. Add ('checkbox {text: 'List of race change 2'} "");

    w.Tabs [0]. Add (' Panel {text: "List 1 of change running" preferredSize,: [-1, 160]} "");

    w.Tabs [0]. Add (' Panel {text: 'Running change list 2', preferredSize: [-1, 160]} "");

    I keep a list inside this Panel

    ~ "B1.   Omni before aligning information panel o in omni.

    ~ "B2.   ShopLine before aligning text panel with S in store and identifier with L Flush left text online

    ~ "B3.   Spacing of Deltron Art and logo

    ~ "B4.   Update statement Art Matthews and attribute

    ~ "B5.   A work of shot (some just change green bar Some blue ETC...)

    w.Tabs [0]. Add (' Panel {text: 'OF changes", preferredSize: [-1, 150]}" ");

    w.Tabs [0]. Add (' Panel {text: ' in baking or paste content ", preferredSize: [-1, 80]}" ");

    with(w.Tabs[0])

    {

    with (Add (' group {alignment: "left"} ""))

    {

    Add (' button {text: 'Reset al warning dialog boxes'} "");

    }

    }

    w.Tabs [1] = w.tabGroup.add ("group");

    w.Tabs [1]. Add ("statictext {text: 'Interface'}");

    w.Tabs [1]. Add (' Panel {preferredSize: [-1, -10]} "");

    w.Tabs [1]. Add (' Panel {text: "what needs changed," preferredSize: [-1, 300]} "");

    w.Tabs [1]. Add (' Panel {text: 'Options', preferredSize: [-1, 100]} "");

    w.Tabs [2] = w.tabGroup.add ("group");

    w.Tabs [2]. Add ("statictext {text:"Interface user Scaling"}");

    w.Tabs [2]. Add ("panel");

    w.Tabs [2]. Add (' Panel {text: "Example" preferredSize: [-1, 200]} "");

    I would like to integrate a picture in the sample box

    w.Buttons = w.add ("group {alignment: 'right'}");

    w.Buttons.Add ("button {text: 'OK'}");

    w.Buttons.Add ("button {text: 'Cancel'}");

    for)

    var i = 0;

    I < w.tabs.length;.

    i++){

    w.Tabs [i] .orientation = "column";

    w.Tabs [i] .alignChildren = 'bridge '.

    w.Tabs [i]. Alignment = ["fill",""];

    w.Tabs [i]. Visible = false;

    }

    w.stubs.onChange = showTab;

    function

    showTab)

    {

    If (w.stubs.selection! == null) {for (var i = w.tabs.length - 1; i > = 0;)}

    i-)

    {

    w.Tabs [i]. Visible = false;

    }

    w.Tabs [w.stubs.Selection.index]. Visible = true;

    }

    }

    w.onShow = function()

    {

    w.stubs.Selection = 1;

    showTab;

    }

    w.Show ();

    Try this... See line 58... do this and run the script

    var myResult;
    var w =new Window ('dialog {text: "Running Changes", orientation: "column", alignChildren:["fill","fill"],   properties:   {closeButton:   false}}');
    
          w.main =w.add ('group {preferredSize: [600, 500], alignChildren: ["left","fill"]}');
          w.stubs  = w.main.add ('listbox', undefined, ['Changes Made', 'Check For Changes', 'Example']);
        w.stubs.preferredSize.width  = 150;  w.tabGroup  = w.main.add ('group {alignment: ["fill","fill"], orientation: "stack"}');
          w.tabs  =[];
        w.tabs[0]= w.tabGroup.add ('group');
        w.tabs[0].add('statictext {text: "Changed"}');
                   w.tabs  =[];
        w.tabs[0]= w.tabGroup.add ('group');
        w.tabs[0].add('statictext {text: "Select a change to make"}');
                 w.tabs[0].add ('panel');
        var RunCH1= w.tabs[0].add ('checkbox {text: "Run Running Change List1"}');// Activate the Find and replace Script
    
    //~              IF possible i would this script to be exicuted if the above check mark is selected. After pressing OK button
    //~              if this button is not selected i dont wnat this part of the script to activate.
    
                 var RunCH2= w.tabs[0].add ('checkbox {text: "Running Change list 2"}');
                 var Pan1=w.tabs[0].add ('panel {text: "Running Change list 1", preferredSize: [-1, 160],orientation: "column",alignChildren: ["left","fill"]}');
                 w.tabs[0].add ('panel {text: "Running Change list 2", preferredSize: [-1, 160]}');
    
                Pan1.add('statictext {text: "B1.   Omni Align Front panel information to the O in omni"}');
                Pan1.add('statictext {text: "B2.   ShopLine Align Front panel text with S in Shop and Identifier with L in line Flush Left text"}');
                Pan1.add('statictext {text: "B3.   Deltron Spacing around Art and logo"}');
                Pan1.add('statictext {text: "B4.   Matthews Art and Attribute statement update"}');
                Pan1.add('statictext {text: "B5.   One Shot Artwork (Some change to Just green bar Some Blue ETC..."}');
    
                        // I would like a list inside this panel
    
                 w.tabs[0].add ('panel {text: "NON Changes to be made", preferredSize: [-1, 150]}');
                 w.tabs[0].add ('panel {text: "When placing or pasting content", preferredSize: [-1, 80]}');
        with(w.tabs[0])
        {
        with(add ('group {alignment: "left"}'))
        {
                       add ('button {text: "Reset al warning dialogs"}');
        }
        }
            w.tabs[1]= w.tabGroup.add ('group');
            w.tabs[1].add ('statictext {text: "Interface"}');
            w.tabs[1].add ('panel {preferredSize: [-1, -10]}');
            w.tabs[1].add ('panel {text: "What Needs Changed", preferredSize: [-1, 300]}');
    
            w.tabs[1].add ('panel {text: "Options", preferredSize: [-1, 100]}');
            w.tabs[2]= w.tabGroup.add ('group');
            w.tabs[2].add ('statictext {text: "UI Scaling"}');
            w.tabs[2].add ('panel');
            w.tabs[2].add ('panel {text: "Example", preferredSize: [-1, 200]}');
            flower=w.tabs[2].add ("image", undefined, File ("~/\Desktop/\xxx.jpg"));//place you image in desktop and put the image name in the place of "xxx"
    
                 // I would like to embed a Picture in the Example BOx
    
          w.buttons  = w.add ('group {alignment: "right"}');
         w.buttons.add  ('button {text: "OK"}');
        w.buttons.add  ('button {text: "Cancel"}');
        for(
        var i = 0;
         i < w.tabs.length;
         i++){
        w.tabs[i].orientation ='column';
        w.tabs[i].alignChildren ='fill';
        w.tabs[i].alignment =['fill','fill'];
        w.tabs[i].visible =false;
        }
        w.stubs.onChange  = showTab;
        function
         showTab ()
        {
        if(w.stubs.selection !==null){for(var i = w.tabs.length-1; i >= 0;
         i--)
         {
             w.tabs[i].visible =false;
        }
                 w.tabs[w.stubs.selection.index].visible =true;
        }
        }
          w.onShow  =function()
        {
        w.stubs.selection  = 1;
        showTab;
        }
    
     myResult = w.show();
        if(myResult == 1 && (RunCH1.value==true || RunCH2.value==true) ){
        alert("in")
        Replace_TXT("  ", "^p");
        Replace_TXT("  ", " ");
        Replace_TXT(" :", ":");
        Replace_TXT(" .", ".");
        Replace_TXT("^p^p", "^p");
        Replace_TXT(" ", "^p");
        w.close (true);
    }   
    
    function Replace_TXT(input, output)
    {
    //app.selection[0];
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.findWhat = input;
    app.changeTextPreferences.changeTo = output;
    app.activeDocument.changeText();
    } 
    
  • Need help please this script.

    Hi this works a bit.   I want to search and replace to work with text blocks I selected only.  And if possible to get the part resizing text only resize only once.  Now if I continue to by clicking on the Script he keeps shrink the text and I just want it fits 1 time.  Then after its been maybe say 'Already formatted text' as I don't know if I had the right of the description.  I mean what is the script when go over it with my mouse.  Any help will be appreciated.

    DESCRIPTION: Replace < CR > with hard back/font resizing to fit the text block

    Replace ("< CR >", "Back")

    Replace ("< CR >", "^ p")

    Replace (input, output) function

    {

    App.Selection [0];

    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

    app.findTextPreferences.findWhat = entry;

    app.changeTextPreferences.changeTo = output;

    app.activeDocument.changeText ();

    }

    var myTextFrame = app.selection [0];

    var myText = myTextFrame.parentStory.texts [0];

    {}

    myText.pointSize = myText.pointSize-. 01;

    } If (myTextFrame.overflows == true);

    Use this

    Replace("  ", "^p")           
    
        function Replace(input, output)
        {
            app.selection[0];
            app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
            app.findTextPreferences.findWhat = input;
            app.changeTextPreferences.changeTo = output;
            app.activeDocument.changeText();
    
        }
    
        var myTextFrame = app.selection[0];
        var myText = myTextFrame.parentStory.texts[0];
    try{
        do {
    
            myText.pointSize = myText.pointSize - .01;
            } while (myTextFrame.overflows == true);
        }
    catch(e){
        alert("Text already Formatted")
        }
    
  • Help with dynamic scripting for drift property

    Hello

    I try to get the list nodes children, then loopthorugh the nodes to do some calculations in a property derived by using dynamic scripts. I tried with the below script.

    var childEnumerator is node. GetChildEnumerator();

    While (childEnumerator.MoveNext ())

    {

    var varValeurProp = childEnumerator.GetCurrent (). PropValue ("Custom.Salary");

    Print (propvalue);

    }

    While evaluating this script, I get an error below. No idea what I'm missing here?

    DRM-16008: there was a calculation Script Custom.TotalSalaryExp for EMP_Zone/Emp/PPD1 property error: TypeError: 'GetChildEnumerator' is not a function

    Please help me. Thank you fr your cooperation

    Kind regards

    Nathalie

    Try this instead...

    var childEnumerator is node. GetChildEnumerator();

    childEnumerator.MoveNext ();

    While (childEnumerator.GetCurrent ()! = null)

    {

    var varValeurProp = childEnumerator.GetCurrent (). PropValue ("Custom.Salary");

    Print (propvalue);

    childEnumerator.MoveNext ();

    }

  • 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

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

Maybe you are looking for

  • USB-6211 w / DAQmx

    Hello all,. Asking if any user can check that the DAQmx; Channel Properties node; Filter; Calculation of the average of windowing is supported by the NI USB-6211 OEM Board? This feature is essential for the intended application and need to know befor

  • Can't access webOS app store: error message - action could not be completed

    Whenever I try to open the app catalog of HP application starts and the 'home' screen will load but then immediately an error will say popup "action failed. Try again later. "and then I can't access anything within the app so I can't download new app

  • Have no sound and no sound on the taskbar icon

    my sound went, my device manager did not help; my taskbar at the bottom of the screen does not include anes sound or VNC to etc. I tried to restore my computer, but it won't allow me. Original title: suddenly I have no sound, my taskbar is incomplete

  • Drag / move does not work

    Windows Explorer - updated my computer with the latest updates of Windows XP on February 26 - since then the function drag / move on Windows Explorer (and my office) didn't work. I did a scan full antivirus and came out the own. Also checked the prop

  • Default volume on the unit is not set when I create player

    Hi all When I create a player using a streaming link, the player has different volume then a current volume on the unit. Also the change in volume by volume keys is not effect anything. Can someone advice me please. Kind regards Roney