PS CS6 Javascript

I use a Mac, but the script works for Mac and PC, great for any Photoshop CS3 or higher.

Basically, I'm using three different actions.

1. If the image is over 2000 px wide or high, it will run action "approve".

2. If the image is between 1200 and 1999 px - it will run the action of 'Acceptable '.

3 - If the image is smaller than 1199 px - it will run the action "reject".

I hope that makes sense on what I want.

DEPARTURES FROM SCRIPT BELOW.

app.displayDialogs = DialogModes.NO;

var strtRulerUnits = preferences.rulerUnits;

preferences.rulerUnits = Units.INCHES;

var Web_Action = "NWS-APPROVE";

var = "NWS-APPROVE" approved

Acceptable var = "NWS-APPROVE";

rejected var = "NWS-APPROVE";

This will get rid of the extra alpha channels

app.activeDocument = docRef;

var i = 4;

while(DocRef.Channels.Length>4)

//{

docRef.channels [i] .remove ();

//}

activeDocument.save ();

If (activeDocument.width > = 3000 | activeDocument.height > = 3000)

{

app.doAction ("approve", "NWS-APPROVE");

Alert ('small'); or send a message

activeDocument.close (SaveOptions.DONOTSAVECHANGES);

}

If (activeDocument.width < = 1500: activeDocument.height < = 1500)

{

app.doAction ('Acceptable', "NWS-APPROVE");

Alert ('small'); or send a message

activeDocument.close (SaveOptions.DONOTSAVECHANGES);

}

If (activeDocument.width < = 1200: activeDocument.height < = 1200)

{

app.doAction ("rejected", "NWS-APPROVE");

Alert ('small'); or send a message

activeDocument.close (SaveOptions.DONOTSAVECHANGES);

}

preferences.rulerUnits = strtRulerUnits;

end

So, after reading some things more. This one works! ".as ('px') is necessary for the program to recognize the specific sizes.

app.displayDialogs = DialogModes.NO;

var strtRulerUnits = preferences.rulerUnits;

preferences.rulerUnits = Units.INCHES;

This script at the top of the page allows the script to be registered on Photoshop as an action.

var longestSide;

If (activeDocument.height > activeDocument.width) {}

longestSide = activeDocument.height;

} else {}

longestSide = activeDocument.width;

}

If (longestSide.as ('px')<>

{

app.doAction ("rejected", "NWS-APPROVE");

}

ElseIf (longestSide.as ('px')<=>

{

app.doAction ('Acceptable', "NWS-APPROVE");

}

on the other

{

app.doAction ("approve", "NWS-APPROVE");

}

preferences.rulerUnits = strtRulerUnits;

end

Tags: Photoshop

Similar Questions

  • CS6 javascript tutorial scripts

    I apologize if this question has already been answered: I searched the forums with no result.

    I'll try to find the scripts that accompany the tutorial available on the InDesign developer documentation site JavaScript pdf

    The InDesign developer documentation | Adobe Developer Connection...

    The link to the tutorial scripts pointing to examples of scripts, and many more tutorial scripts. I have the tutorial for CS5 files, but many of them do not work for me in CS6.

    These files are available elsewhere? I can't find a way to contact Adobe to ask, because the contact support head to the forums.

    I have a number of learning resources, but the real scripts are very valuable when I try to follow the tutorials.

    Thanks for any help!

    I think they are all in the InDesign Scripting SDK, available here:

    http://www.Adobe.com/devnet/InDesign/SDK.html

    Ariel

  • CS6 JavaScript problem

    Hi when I try to load browse in bridge from photoshop CS6 64 bit, it says that it cannot find the javascript plugin, also does not load 2 of my extensions. Namely Kuboto dashboard pro 4 and OnOne enacted.9 perfect. Yet the 32-bit version works fine tried uninstalling and re - install, update all about without success begins to pull my hair out now please help I want to be bald!

    8.1 Windows 64-bit

    Thanks Mick

    Many thanks to JJMack for the answer, software nik deleted and everything is well, even once, would like to understand why it work for so long with nik software then stopped all of a sudden? anyway thanks for your help in solving this problem.

    Mick.

  • Why I can't download "Adobe InDesign CS6: JavaScript" documentation?

    I use IE provided with Windows 8 on a computer that Lenovo N581 and Adobe Acrobat XI Pro Version 11.0.2.

    When I click on the link:http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/sdk/cs6/scri can't/InDesign_ScriptingGuide_JS.pdfv.

    The next dialog box with the messge, I get:

    Error2.jpg

    Why? Is that what the pdf doc or my version of acrobat pro? Thank you.

    Kind regards

    John

    This link works for me.

    Try a different broswser.

  • CS6 javascript - textBox.contents does not return the full text

    I use script tags to find the text of a certain tag boxes and get their content. Sometimes I'm not all of the content. Is that all that I should check to find my error? It's the js that I use:

    myDoc var = app.activeDocument;

    var myPageItems = myDoc.allPageItems;

    for (var i = 0; i < myPageItems.length; i ++)

    {

    If (myPageItems [i] .label == "carpet details colors 1")

    {

    var myOverFlowFrame = myPageItems [i];

    if(myOverFlowFrame.Overflows==true)

    {

    var fullText = myOverFlowFrame.contents + ";

    Alert (fullText);

    }

    }

    }

    I don't have much experience scripts against InDesign and would appreciate any help I could get. Is there a better way than .silence for the text in a text box? Is there an obvious reason why it would fail to retrieve all of the text in some cases?

    Post edited by: rockymcclamrock (removed irrelevant code)

    Hello

    You can get the full text using the content of the TextFrame ParentStory,

    var fullText = myOverFlowFrame.parentStory.contents + ";

    Thank you

  • Photoshop uses JavaScript to load documents open in the order of the corresponding color

    Hello

    I am a production artist and I make use of the corresponding color command a lot in my work. I often 6-10 Photoshop documents open and one of them is designated as my master document. With this document, I run the command of the corresponding color. Inside of the dialogue of the corresponding color, I charge one of the other open documents in the Source dropdown under statistics of images. I click Ok, and then save the master document under a new name. I have to repeat this step for all open documents. Naturally, it becomes tedious.


    I started to write a script to automate this process, but I can't find the syntax for the corresponding color. I have the Adobe Photoshop Cs6 Javascript Scripting reference, but have been unable to locate in this PDF file. I tried to look online, but no luck. Does anyone know what syntax to use as well as associated properties / methods?

    Thanks for any help.

    Try this:

    //
    // MatchColor.jsx
    // The source image must be the active document at the time this
    // script is run.
    //
    function matchColor(fileName) {
      function cTID(s) { return app.charIDToTypeID(s); };
      function sTID(s) { return app.stringIDToTypeID(s); };
        var desc11 = new ActionDescriptor();
        desc11.putInteger( cTID('Lght'), 100 );
        desc11.putInteger( cTID('ClrR'), 100 );
        desc11.putInteger( cTID('Fade'), 0 );
        desc11.putBoolean( cTID('fsel'), true );
            var ref8 = new ActionReference();
            ref8.putProperty( cTID('Lyr '), cTID('Bckg') );
            ref8.putName( cTID('Dcmn'), fileName);
        desc11.putReference( cTID('Srce'), ref8 );
        executeAction( sTID('matchColor'), desc11, DialogModes.NO );
    };
    
    function main() {
      if (app.documents.length < 2) {
        alert("At least 2 images must be open for this script to run.");
        return;
      }
      var srcdoc = app.activeDocument;
      var srcname = srcdoc.name;
      var docs = app.documents;
      var len = docs.length;
      for (var i = 0; i < len; i++) {
        var doc = docs[i];
        if (doc.name == srcname) {
          continue;
        }
        app.activeDocument = doc;
        matchColor(srcname);
      }
      app.activeDocument = srcdoc;
    };
    main();
    
    "matchColor.jsx";
    //EOF
    
  • use Image catalog script for the current document

    Is it possible to use the script to image catalogue for the current document in which we work instead of leaving the mark of script a new document fees for placed images?

    use,

    //ImageCatalog.jsx
    //An InDesign CS6 JavaScript
    /*
    @@@BUILDINFO@@@ "ImageCatalog.jsx" 3.0.0 15 December 2009
    */
    //Creates an image catalog from the graphic files in a selected folder.
    //Each file can be labeled with the file name, and the labels are placed on
    //a separate layer and formatted using a paragraph style ("label") you can
    //modify to change the appearance of the labels.
    //
    //For more information on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //Or visit the InDesign Scripting User to User forum at http://www.adobeforums.com .
    //
    //The myExtensions array contains the extensions of the graphic file types you want
    //to include in the catalog. You can remove extensions from or add extensions to this list.
    //myExtensions is a global. Mac OS users should also look at the file types in the myFileFilter function.
    main();
    function main(){
      var myFilteredFiles;
      //Make certain that user interaction (display of dialogs, etc.) is turned on.
      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
      myExtensions = [".jpg", ".jpeg", ".eps", ".ps", ".pdf", ".tif", ".tiff", ".gif", ".psd", ".ai"]
      //Display the folder browser.
      var myFolder = Folder.selectDialog("Select the folder containing the images", "");
      //Get the path to the folder containing the files you want to place.
      if(myFolder != null){
      if(File.fs == "Macintosh"){
      myFilteredFiles = myMacOSFileFilter(myFolder);
      }
      else{
      myFilteredFiles = myWinOSFileFilter(myFolder);
      }
      if(myFilteredFiles.length != 0){
      myDisplayDialog(myFilteredFiles, myFolder);
      alert("Done!");
      }
      }
    }
    //Windows version of the file filter.
    function myWinOSFileFilter(myFolder){
      var myFiles = new Array;
      var myFilteredFiles = new Array;
      for(myExtensionCounter = 0; myExtensionCounter < myExtensions.length; myExtensionCounter++){
      myExtension = myExtensions[myExtensionCounter];
            myFiles = myFolder.getFiles("*"+ myExtension);
      if(myFiles.length != 0){
      for(var myFileCounter = 0; myFileCounter < myFiles.length; myFileCounter++){
      myFilteredFiles.push(myFiles[myFileCounter]);
      }
      }
      }
      return myFilteredFiles;
    }
    function myMacOSFileFilter(myFolder){
      var myFilteredFiles = myFolder.getFiles(myFileFilter);
      return myFilteredFiles;
    }
    //Mac OS version of file filter
    //Have to provide a separate version because not all Mac OS users use file extensions
    //and/or file extensions are sometimes hidden by the Finder.
    function myFileFilter(myFile){
      var myFileType = myFile.type;
      switch (myFileType){
      case "JPEG":
      case "EPSF":
      case "PICT":
      case "TIFF":
      case "8BPS":
      case "GIFf":
      case "PDF ":
      return true;
      break;
      default:
      for(var myCounter = 0; myCounter-1){
      return true;
      break;
      }
      }
      }
      return false;
    }
    function myDisplayDialog(myFiles, myFolder){
      var myLabelWidth = 112;
      var myStyleNames = myGetParagraphStyleNames(app);
      var myLayerNames = ["Layer 1", "Labels"];
      var myDialog = app.dialogs.add({name:"Image Catalog"});
      with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Information:"});
      }
      with(borderPanels.add()){
      with(dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Source Folder:", minWidth:myLabelWidth});
      staticTexts.add({staticLabel:myFolder.path + "/" + myFolder.name});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Images:", minWidth:myLabelWidth});
      staticTexts.add({staticLabel:myFiles.length + ""});
      }
      }
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Options:"});
      }
      with(borderPanels.add()){
      with(dialogColumns.add()){
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Rows:", minWidth:myLabelWidth});
      var myNumberOfRowsField = integerEditboxes.add({editValue:3});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Number of Columns:", minWidth:myLabelWidth});
      var myNumberOfColumnsField = integerEditboxes.add({editValue:3});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Horizontal Offset:", minWidth:myLabelWidth});
      var myHorizontalOffsetField = measurementEditboxes.add({editValue:12, editUnits:MeasurementUnits.points});
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:"Vertical Offset:", minWidth:myLabelWidth});
      var myVerticalOffsetField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
      }
      with (dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Fitting:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myFitProportionalCheckbox = checkboxControls.add({staticLabel:"Proportional", checkedState:true});
      var myFitCenterContentCheckbox = checkboxControls.add({staticLabel:"Center Content", checkedState:true});
      var myFitFrameToContentCheckbox = checkboxControls.add({staticLabel:"Frame to Content", checkedState:true});
      }
      }
      with(dialogRows.add()){
      var myRemoveEmptyFramesCheckbox = checkboxControls.add({staticLabel:"Remove Empty Frames:", checkedState:true});
      }
      }
      }
      with(dialogRows.add()){
      staticTexts.add({staticLabel:""});
      }
      var myLabelsGroup = enablingGroups.add({staticLabel:"Labels", checkedState:true});
      with (myLabelsGroup){
      with(dialogColumns.add()){
      //Label type
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Type:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
      }
      }
      //Text frame height
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Height:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelHeightField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
      }
      }
      //Text frame offset
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Offset:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelOffsetField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.points});
      }
      }
      //Style to apply
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Label Style:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
      }
      }
      //Layer
      with(dialogRows.add()){
      with(dialogColumns.add()){
      staticTexts.add({staticLabel:"Layer:", minWidth:myLabelWidth});
      }
      with(dialogColumns.add()){
      var myLayerDropdown = dropdowns.add({stringList:myLayerNames, selectedIndex:0});
      }
      }
      }
      }
            var myResult = myDialog.show();
            if(myResult == true){
      var myNumberOfRows = myNumberOfRowsField.editValue;
      var myNumberOfColumns = myNumberOfColumnsField.editValue;
      var myRemoveEmptyFrames = myRemoveEmptyFramesCheckbox.checkedState;
      var myFitProportional = myFitProportionalCheckbox.checkedState;
      var myFitCenterContent = myFitCenterContentCheckbox.checkedState;
      var myFitFrameToContent = myFitFrameToContentCheckbox.checkedState;
      var myHorizontalOffset = myHorizontalOffsetField.editValue;
      var myVerticalOffset = myVerticalOffsetField.editValue;
      var myMakeLabels = myLabelsGroup.checkedState;
      var myLabelType = myLabelTypeDropdown.selectedIndex;
      var myLabelHeight = myLabelHeightField.editValue;
      var myLabelOffset = myLabelOffsetField.editValue;
      var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
      var myLayerName = myLayerNames[myLayerDropdown.selectedIndex];
      myDialog.destroy();
      myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName);
            }
      else{
      myDialog.destroy();
      }
      }
    }
    function myGetParagraphStyleNames(myDocument){
      var myStyleNames = new Array;
      var myAddLabelStyle = true;
      for(var myCounter = 0; myCounter < myDocument.paragraphStyles.length; myCounter++){
      myStyleNames.push(myDocument.paragraphStyles.item(myCounter).name);
      if (myDocument.paragraphStyles.item(myCounter).name == "Labels"){
      myAddLabelStyle = false;
      }
      }
      if(myAddLabelStyle == true){
      myStyleNames.push("Labels");
      }
      return myStyleNames;
    }
    function myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName){
      var myPage, myFile, myCounter, myX1, myY1, myX2, myY2, myRectangle, myLabelStyle, myLabelLayer;
      var myParagraphStyle, myError;
      var myFramesPerPage = myNumberOfRows * myNumberOfColumns;
      var myDocument = app.activeDocument;
      myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
      myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
      var myDocumentPreferences = myDocument.documentPreferences;
      var myNumberOfFrames = myFiles.length;
      var myNumberOfPages = Math.round(myNumberOfFrames / myFramesPerPage);
      if ((myNumberOfPages * myFramesPerPage) < myNumberOfFrames){
      myNumberOfPages++;
      }
      //If myMakeLabels is true, then add the label style and layer if they do not already exist.
      if(myMakeLabels == true){
      try{
      myLabelLayer = myDocument.layers.item(myLayerName);
      //if the layer does not exist, trying to get the layer name will cause an error.
      myLabelLayer.name;
      }
      catch (myError){
      myLabelLayer = myDocument.layers.add({name:myLayerName});
      }
      //If the paragraph style does not exist, create it.
      try{
      myParagraphStyle = myDocument.paragraphStyles.item(myLabelStyle);
      myParagraphStyle.name;
      }
      catch(myError){
      myDocument.paragraphStyles.add({name:myLabelStyle});
      }
      }
      myDocumentPreferences.pagesPerDocument = myNumberOfPages;
      myDocumentPreferences.facingPages = false;
      var myPage = myDocument.pages.item(0);
      var myMarginPreferences = myPage.marginPreferences;
      var myLeftMargin = myMarginPreferences.left;
      var myTopMargin = myMarginPreferences.top;
      var myRightMargin = myMarginPreferences.right;
      var myBottomMargin = myMarginPreferences.bottom;
      var myLiveWidth = (myDocumentPreferences.pageWidth - (myLeftMargin + myRightMargin)) + myHorizontalOffset
      var myLiveHeight = myDocumentPreferences.pageHeight - (myTopMargin + myBottomMargin)
      var myColumnWidth = myLiveWidth / myNumberOfColumns
      var myFrameWidth = myColumnWidth - myHorizontalOffset
      var myRowHeight = (myLiveHeight / myNumberOfRows)
      var myFrameHeight = myRowHeight - myVerticalOffset
      var myPages = myDocument.pages;
      // Construct the frames in reverse order. Don't laugh--this will
      // save us time later (when we place the graphics).
      for (myCounter = myDocument.pages.length-1; myCounter >= 0; myCounter--){
      myPage = myPages.item(myCounter);
      for (var myRowCounter = myNumberOfRows; myRowCounter >= 1; myRowCounter--){
      myY1 = myTopMargin + (myRowHeight * (myRowCounter-1));
      myY2 = myY1 + myFrameHeight;
      for (var myColumnCounter = myNumberOfColumns; myColumnCounter >= 1; myColumnCounter--){
      myX1 = myLeftMargin + (myColumnWidth * (myColumnCounter-1));
      myX2 = myX1 + myFrameWidth;
      myRectangle = myPage.rectangles.add(myDocument.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:myDocument.swatches.item("None")});
      }
      }
      }
      // Because we constructed the frames in reverse order, rectangle 1
      // is the first rectangle on page 1, so we can simply iterate through
      // the rectangles, placing a file in each one in turn. myFiles = myFolder.Files;
      for (myCounter = 0; myCounter < myNumberOfFrames; myCounter++){
      myFile = myFiles[myCounter];
      myRectangle = myDocument.rectangles.item(myCounter);
      myRectangle.place(File(myFile));
      myRectangle.label = myFile.fsName.toString();
      //Apply fitting options as specified.
      if(myFitProportional){
      myRectangle.fit(FitOptions.proportionally);
      }
      if(myFitCenterContent){
      myRectangle.fit(FitOptions.centerContent);
      }
      if(myFitFrameToContent){
      myRectangle.fit(FitOptions.frameToContent);
      }
      //Add the label, if necessary.
      if(myMakeLabels == true){
      myAddLabel(myRectangle, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myLayerName);
      }
      }
      if (myRemoveEmptyFrames == 1){
      for (var myCounter = myDocument.rectangles.length-1; myCounter >= 0;myCounter--){
      if (myDocument.rectangles.item(myCounter).contentType == ContentType.unassigned){
      myDocument.rectangles.item(myCounter).remove();
      }
      else{
      //As soon as you encounter a rectangle with content, exit the loop.
      break;
      }
      }
      }
    }
    //Function that adds the label.
    function myAddLabel(myFrame, myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myLayerName){
      var myDocument = app.documents.item(0);
      var myLabel;
      var myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
      var myLabelLayer = myDocument.layers.item(myLayerName);
      var myLink =myFrame.graphics.item(0).itemLink;
      //Label type defines the text that goes in the label.
      switch(myLabelType){
      //File name
      case 0:
      myLabel = myLink.name;
      break;
      //File path
      case 1:
      myLabel = myLink.filePath;
      break;
      //XMP description
      case 2:
      try{
      myLabel = myLink.linkXmp.description;
      if(myLabel.replace(/^\s*$/gi, "")==""){
      throw myError;
      }
      }
      catch(myError){
      myLabel = "No description available.";
      }
      break;
      //XMP author
      case 3:
      try{
      myLabel = myLink.linkXmp.author
      if(myLabel.replace(/^\s*$/gi, "")==""){
      throw myError;
      }
      }
      catch(myError){
      myLabel = "No author available.";
      }
      break;
      }
      var myX1 = myFrame.geometricBounds[1];
      var myY1 = myFrame.geometricBounds[2] + myLabelOffset;
      var myX2 = myFrame.geometricBounds[3];
      var myY2 = myY1 + myLabelHeight;
      var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
      myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
      myTextFrame.parentStory.texts.item(0).appliedParagraphStyle = myLabelStyle;
    }
    
  • Create a gradient of the script.

    Create a gradient by scripts, the command stops and color.

    Do not understand in the document of reference Photoshop cs6 javaScript, how and where to access the gradient.

    Please help me, I can't do day after day...

    The principle of the script consists of scanning in black and white and the texture of the color of the pixel, registration of the colours in the painting.

    So in order to decompose the matrix of color from 0 to 255 black and white texture.

    Until you get the texture gradient.

    0 where blacks where 255 white. each color will be assigned a user ID and it will move to the color in the color gradient texture.

    Sorry for my English.

    Thank you!

    For a large a gradient with script, you must use scriptlistener. Then modify the variables in this code to match what you want. I use this method to create gradients on the forms which are sampled from a reference image.

  • How to get the track changes inserted / deleted text?

    Hello

    I have read the Adobe InDesign CS6 JavaScript Scripting Guide and wrote a JavaScript as below:

    var myChanges = app.documents.everyItem().stories.everyItem().changes;
    var myString = '';
    for (var i=0; i<myChanges.length; i++) {
            var myChange = myChanges[i];
            myString += myChange.userName + '\t';
            myString += myChange.date + '\t';
            myString += myChange.changeType + '\n';
    }
    alert(myString);
    

    My script can get the username, date and change the type.

    But the guide does not cover on how we can get him insert / delete changes?

    Thank you very much!

    The lines I wrote above deleted content work.

    Your problem is that not remove anything to show him because you started to follow the story of its creation.

    If you first create a story and then start tracking it and add, remove etc. your will see the scripts to get also deleted ones.

  • Reference UI info (window, dialog, palette, etc.) for scripts to HAVE

    I'm looking for information of standard reference on elements of user interface like the pop-up windows (dialogs, palettes, etc.). I went through the Scripting of Illustrator CS6 Javascript reference guide and also the CS6 Scripting guide, checking every mention of the words 'Window', 'Dialogue', 'Pallet' etc. (it there is no much), over related terms such as "edittext" and "slider" (which apparently do not exist in these documents in all) and can't find what I'm looking for.

    ----------

    I'm trying to script a simple information box that contains information generated by a script that doesn't have to be closed before the user continues to operate.

    What I'm trying to find out is essential. Looking at other scripts I realized that you can create a popup like this box:

    var box = new Window('dialog', 'Some title');
    
    var panel = box.add(panel, undefined, 'Panel title');
    panel.add('edittext', undefined, 'Default value');
    panel.add('slider', undefined, /*Default numeric value*/,/*min*/,/*max*/);
    
    var group = box.add(group, undefined, 'Group title');
    group = area_len_box.add('group', undefined, 'Title (not displayed)');
    group.orientation='row';
    group.closeBtn = group.add('button',undefined, 'Close', {name:'close'});
    group.closeBtn.onClick = function(){
      box.hide();
      return false;
    }
    

    .. .this which is enough for a very basic entry system, but which must be closed before the user can return to their work - and I can't find any resource that gives the full options:

    • What are the other options for "new window"? I am aware of the "palette", which appears to need a table of four coordinates such as [20,20,100,100], but he clearly needs something else too, as each pallet I did instantly closes. And what else is there beyond the window and the Palette?
    • What other input devices are there beyond edittext and slider, and what are the parameters they each need?
    • What can go in the s 'undefined' that I see everywhere wherever they are used?
    • etc etc.

    There must be a reference to it somewhere, but I can't.

    Here is an attempt at a consolidated whole:

    Script interface elements are similar for all Adobe applications - called "ScriptUI". There are two PDF files:

    There are two ways to browse the structure of the object to see what is available:

  • How to print colors specific spots in separations?

    I'm still a newbie to ExtendScript & JavaScript, but I learn quickly. Right now, I need to find a way to tell InDesign to print specific pages in the active document with a "Preset" printer and - here's the best - only using some spot colors.  (The preset already allows separations.)

    Now, I followed the Guide from Adobe InDesign CS6 JavaScript scripts on pages 47-51 as Jongware guide on the subject. However, two only refers to turning money or shut down the Cyan, Magenta, yellow, black or channels (using the methods .printCyan, .printMagenta, etc.); There is no mention for spot colors that exist in the document.

    When you use the dialog box print normally, you just click the output tab and click on the little printer boxes (essentially the boxes) beside each separation of color that you want to print. Surely this can be replicated in ExtendScript, but how?

    what you are looking for is Document.inks

    http://jongware.mit.edu/idcs5/pc_Ink.html

    each ink has a property printInk, you can use

  • Different results, running the same Javascript - CC vs CS6

    I am having some problems affecting the font size of a text using Javascript. For some reason, I always get characters of 2.88 points as opposed to what I put it to (in this case, it's 12). Anyone know what is the problem that the PS is not recognizing the command to set the font size here and why?

    #9740928-Pastie

    Line 42 is where I'll put the size.

    Line 27, that's where the variable is defined. I tried just punching in an integer with the same results.

    Thanks for any help.


    So I think that there could be a problem with Adobe CC or maybe some changes in its development with regard to the way he treats the Javascript. I ran several tests today and did some reading. At the end of the line, I decided to try the script on CS6 and I got the correct results. The script works on CS6, but not cc? I made an example of script I did my tests to take a pic to Adobe team. It's the end of this post.


    I'm not the master script by any stretch of the imagination, but I find it odd that this script works correctly on Adobe CS6, but does not change the size of font correctly on Adobe CC. I expect that same results. If any of you come up with anything please let me know. Cheers.

    BEGINNING OF THE SCRIPT

    var defaultRulerUnits = preferences.rulerUnits;

    preferences.rulerUnits = Units.PIXELS;

    var AD = activeDocument;

    Size = 53;

    var TextLayer = AD.artLayers.add ();

    TextLayer.kind = LayerKind.TEXT;

    TextLayer.opacity = 90;

    var txtRef = TextLayer.textItem;

    txtRef.font = "Impact."

    txtRef.contents = size;  The size of 53 is reflected in CS6, but when this script is run on CC, is not. Sometimes 12, sometimes it is 2.88.

    txtRef.size = size;

    END OF SCRIPT

    ^ I save it as a. JS


    Post edited by: Clayton Krause

    The ruin of font size of DOM somewhere in 2014 of the CC is a known problem.

    Re: Do you have CC 2014.2 break textItem.size?

    The alternative would use code AM.

  • HTML5 reference code works is not inside the Javascript on DW CS6 function

    Hello

    I'm working on Dreamweaver CS6 and indicators of code does not work as expected when you write Javascript code.

    The minute that I insert a code hinting feature no longer appears the HTML5 elements.

    dw-with-function.gif

    Should I remove the function then him reappears indicators of HTML5.

    dw-no-function.gif

    How can I get the code referring to work when I add in the function?

    Thank you

    Herman

    Thank you for reporting this issue, Herman!

    We have recorded a bug for it and you're tracking internally.

  • CS6 findchangebuylist with javascript error

    Running Mac OS 10.6.8

    iMac 2.93 GHz Intel Core i7

    4 GB 1333 MHz DDR3

    InDesign CS6 8.0.1

    I created a new page with nothing on it except a text box. I imported some paragraph styles and text for a page master templatre created for a catalog that I've created. I created the new page to try to eliminate any problems that may have been cause by opending a document created in CS5.5. I use the latest version of 'recordfindchange' script for cs3 - cs5 written by Martin Fisher to export the result of my test of the findchange. Here is a picture of the findchange Choir:

    Screen shot 2013-07-26 at 10.05.22 AM.png

    I get an error in java script when I run the script copy buy, I created the "findchangebylist: javascript and txt, file by adding the _SimpleTest name to the names of files and replaceing the 116 line number in javascript with this:

    var myFindChangeFile = myFindFile("/FindChangeSupport/findChangeStrings_SimpleTest")

    Here is the error I get:

    Screen shot 2013-07-15 at 2.21.29 PM.png

    I don't know anything about javascript. so I am dead in the water. so can someone please help. Are there problems with the CS6 and the findchangebylist script? "recordfindchange" is no longer works with CS6? Could this be a problem of version of javascript (I've just updated to the latest version)?

    It seems I could have solved my own problem. through diligence, I came to the conclusion that every time you are appling a paragraph or style, you must include a characters ', changeConditionsMode:1919250519' in your grep. If you look above the "findChangeStrings_SimpleTest.txt" you want of course that this has not been added in. so you will get a javascript error. Also, there is an extra ',' (comma and space) in front of "findwhat" and "appliedParagraphStyle" I removed those just for consistency. but he appeard have no effect.

    He shhould look like this:

    {findWhat:"\\r\\r.+[:].+\\r} » {appliedParagraphStyle: '01-Header', changeConditionsMode:1919250519}

    SO in short, it looks like the 'ChangeCondidtionsMode:1919250519' is the key to eliminate the javascript error.

    I don't know why. All that I know is now it works.

    Looking at my file findchange.txt for the project, I am working on (not the one above) I also noticed that here we Eparses characters outside the "{" (in brackets). That was apparently CS6 crash indesign. Where I worked on the script has been written in CS5.5. This version must have been a little more forgiving with sloppy code. After cleaning all the random characters until no more accidents.

    I also have my version 8.0 CS6 upated version 8.0.1. Adobe has a downloadable patch. Who can help the issue as well. However, it has not helped the missing changeCondidtionsMode or sloppy code.

    The RecordFindChange script I was using does not have the "ChangeCondidtionsMode:1919250519" in the exported .txt file and it also adds additional quotes. Which must be changed by a person who knows javascript and that's not me.

    I hope this helps.

  • Is it possible to perform an action with a script using javascript cs6

    It is said in the pdf for the guide of script:

    "A script can perform an action, but action cannot run scripts.

    I can't find a way to do it, and I know a way to have an action to run a script so that the part is wrong haha. But if anyone knows how to have a script to perform an action, it would be very useful for me. Thanks in advance!

    Watch the doScript call which will play a defined action game action. Available for Apple, Visual Basic and from CS6, ExtendScript.

Maybe you are looking for

  • Portege Z930 - minimum installation Windows 7

    I bought the z930, but after the first start, I only 59 GB of space available! Is there a way to have a new facility with a minimum occupancy of storage, get rid of all the Toshibe software? In addition, it is possible to resume the partition of 8 GB

  • QOSMIO F10 and play games such as the XIII or the battlefield

    I have a QOSMIO F10 with XP Home Edition operating systemI live in Iran. I installed a professional XP on my laptop too and most of the games that he is in Iran are cracked. I have problems with games. Some games load without problem these FIFA 2005,

  • Satellite L775 turns off without obvious reason

    I guess it's a problem related to an issue of power. My laptop Satellite L775 is used to turn off and the 2nd (under tension) and the 3 leds (drums) becomes red flashing even if I fix the battery. How can I solve this problem?

  • Re: Satellite P775 program - 11 p and upgrade with the second HARD drive

    I know that you have a second HDD models, but ist it is possible to add a second HDD to my program P775 - 11 p? Because the place and the Bay is already there, only the cables are missing... Help, please...

  • srggsaga

    I'm using Labview 2010 and find a good example that I want to use to create an online - Advanced.vi process in the finder of the example.  I open it and the VI called "Create the shared Variable.vi" is broken.  I can't access the back of the present