New document dimension: options

I found this script to create a new document from a radiobutton choice of dimension; it works very fine, but I need to have the possibility to add a window to enter a personal width if I need to create a new document with no standard dimension.
Can someone help me?
Thnx, Paolo
var UIresult = myDisplayDialog();
if (UIresult.rb[0]){createDocument("41.3", UIresult.docHeight);}
if (UIresult.rb[1]){createDocument("86.1", UIresult.docHeight);}
if (UIresult.rb[2]){createDocument("130.9", UIresult.docHeight);}
if (UIresult.rb[3]){createDocument("175.7", UIresult.docHeight);}
if (UIresult.rb[4]){createDocument("220.5", UIresult.docHeight);}
if (UIresult.rb[5]){createDocument("265.3", UIresult.docHeight);}
if (UIresult.rb[6]){createDocument("310.1", UIresult.docHeight);}
function createDocument(docHeight, docWidth)
var myDocument = app.documents.add();
with(myDocument.documentPreferences){
pageHeight = docHeight + "mm";
pageWidth = docWidth + "mm";
pagesPerDocument = 1;}
function myDisplayDialog()
        var myDialog = new Window ('dialog', 'New document');
        myDialog.alignChildren = "left";
        var rg0 = myDialog.add ('group');
        rg0.add('statictext',undefined, 'number of column:');
          var rb1 = rg0.add('radiobutton',undefined, '1');
          var rb2 = rg0.add('radiobutton',undefined, '2');
          var rb3 = rg0.add('radiobutton',undefined, '3');
          var rb4 = rg0.add('radiobutton',undefined, '4');
          var rb5 = rg0.add('radiobutton',undefined, '5');
          var rb6 = rg0.add('radiobutton',undefined, '6');
          var rb7 = rg0.add('radiobutton',undefined, '7');
          rg0.add('statictext',undefined, 'column');
          rb1.value = true;
          var rg1 = myDialog.add ('group');
        rg1.add('statictext',undefined, 'Height:');
        var docuHeight = rg1.add('edittext',undefined, '100');
        rg1.add('statictext',undefined, 'mm');
        var rg2 = myDialog.add ('group');
        rg2.alignment = "right";
        rg2.add('button', undefined, 'Cancel ', {name: 'cancel'});
        rg2.add('button', undefined, 'OK', {name: 'ok'});
var myResult = myDialog.show();
if (myResult == 1)
     return {rb : [rb1.value, rb2.value, rb3.value, rb4.value, rb5.value, rb6.value, rb7.value], docHeight : docuHeight.text};
if (myResult == 2)
     exit();

Hi,
You can see the additions here:
How to work with Layer Comps | Adobe Photoshop CC tutorials
regards,
steve

Similar Messages

  • I am currently running a trial version of indesign. i am trying to make a cd booklet. when i open a new document and try to find 'compact disc' in the document presets, it isn't there. all i have for options are 'default and custom'. is it possible to ope

    i am currently running a trial version of indesign. i am trying to make a cd booklet. when i open a new document and try to find 'compact disc' in the document presets, it isn't there. all i have for options are 'default and custom'. is it possible to open the 'compact disc' preset from a trial version?

    Are you sure, Eugene? I have this option:

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • Whenever i click on word or powerpoint it always brings up a recent document. I want to have the option like when i had first opened the app that gives the options of new document and the variety of different documents. how do i get it back to that?

    whenever i click on word or powerpoint it always brings up a recent document. I want to have the option like when i had first opened the app that gives the options of new document and the variety of different documents. how do i get it back to that?

    tbreezy wrote:
    THANK U!! K ONE MORE QUICK QUESTION. HOW DO I GET RID OF THAT POP UP BOX?
    Not sure, try googling "the global template normal.dotm is already open as an add-in program"

  • Office Web Apps - How do I get Excel and PowerPoint to show up as options for New Documents?

    When I highlight a list of documents, a ribbon shows up at the top.  The left most action is "New Document".  Despite running and installing Excel and PowerPoint services, the only option that shows up is Word.  How do I add Excel and PowerPoint to that list?
    I have confirmed that I am able to upload, view and edit Excel and PowerPoint.  I just cannot find a way to add them as options in New Document.

    Create Content Types, same as in 2007.
    In a nutshell... Create a content type based on Document and add a PowerPoint template. Go to the library and enable Content Types in Advanced. Add the new content type to the library's list of content types. The New button will now contain the name of this new content type.
    Repeat for Excel.
    More info:
    http://msdn.microsoft.com/en-us/library/ms472236(office.14).aspxMike Smith
    TechTrainingNotes.blogspot.com

  • I am trying to create mobile pages using the steps file new new document page from sample mobile starters jquery mobile (cdn).  When "page from sample" is selected, the subsequent options are not available.  This seems like a silly question, but how do I

    I am trying to create mobile pages using the steps file>new>new document>page from sample>mobile starters>jquery mobile (cdn).  When "page from sample" is selected, the subsequent options are not available.  This seems like a silly question, but how do I acquire these options?

    You can get the latest jQuery Mobile Themes directly from jQuery Mobile's web site.
    https://demos.jquerymobile.com/1.1.0/docs/api/themes.html
    Or roll your own with ThemeRoller
    http://themeroller.jquerymobile.com/
    Nancy O.

  • I am trying to use the liquify tool for the first time. I created a new document (RGB/8) and before I place my photo, the liquify option is available. After I place the photo, the liquify option disappears. What am I doing wrong?

    I am trying to use the liquify tool for the first time. I created a new document (RGB/8). Before I place my photo, the liquify option is available. After I place the photo, the liquify option disappears. What am I doing wrong?

    What am I doing wrong?
    For one thing you forgot to mention the version of Photoshop you use.
    Did you place the image as a Smart Object? Liquify got Smart-capabilities with Photoshop CC.

  • Create New Document - Suddenly Lost Ability for Customer Option

    Hi -
    All of the sudden I can't create a customer profile when creating a new document.  Earlier I selecting the print profile.  I tried opening a new document and creating a custome profile but that option is grayed out. 
    Not sure if this is related but I created custome brushes yesterday but they don't appear today.  Is that because of the profile that the brushes were created with and without that profile I won't see the brushes? 

    I guess I still don't get it.  I create a new brush in print profile but when I open a new doucment with that profile that brush isn't there.
    Print Profile with New Brush Created
    New Doucment with Print Profile

  • Creating a new document/canvas (to add multiple images to)

    I am totally new to Photoshop Elements (using v.13), with some previous experience in old versions of Photoshop. I am an interior designer and I want to make a design board. Essentially what I am trying to do is create a new, blank document layer and then add images of furniture, rugs, etc. Each element needs to be its own layer so that I can edit each individually. I have no idea how to even begin that on here. New document? Open a blank document? When I go to the layers tab, creating layers is not even an option. Obviously, I need some help. Explain this to me as you would to a child....Thanks!

    jennb21985 wrote:
    Each element needs to be its own layer so that I can edit each individually.
    Open the Editor in Expert tab
    Go to File menu>new>blank file. Enter the dimensions, resolution in px/in, and background. This  "canvas" will be the background layer and will show up as such in the layers palette.
    Now, as far as adding pictures of furniture, rugs, etc., I suggest that you prepare each one so that they are ready to be placed on the canvas. Do the math: how large can each one be? Are they all in portrait or landscape orientation? If not, what will be the best fit? Is the brightness/contrast of each picture more-or-less uniform so that the design board will look nice.
    Crop each picture to specification, and save it to disk.
    Once you have done this, do the following:
    Open the blank file
    Open Picture A, go to Select menu>all, then Edit menu>Copy to place it on the clipboard,
    Go back the blank file, then Edit>Paste. Picture A will be on its own layer. Position it with the move tool, and resize with the corner handles, if needed.
    Do the same with pictures B, C, D, etc.
    As indicated above, in the dialog for the blank file, you need to enter a value for resolution. Ideally, the resolution should be the same as that of the picture files. You can check via Image menu>resize>image size. If the resolution is 72 px/in, enter this in the field for the blank file.
    Feel free to repost if this is not clear.

  • Document Dimensions "Box" Disappeared (black box)

    I started Illustrator CS3 today and the dimensions box is no longer visible when I create a new document (sorry, I don't know the term for what I am trying to describe).  Instead of the usual "black box" that shows my canvas, Illustrator loads a Green Box, which I think it is for cropping, right?
    Is there a way I can just reset this and go back to the default settings that I am used too?  I apologize for the vagueness and I appreciate the help.

    jadelson,
    You may try to close down Illy and restart, pressing Cmd+Option+Shift during startup.
    If that does not help, you may Move the folder (instructions included).

  • Photoshop CS5 New Document - RGB as default

    I work in the print industry, and do a fair share of copy + paste into a new photoshop document. My photoshop color settings are set as I need them (CMYK), but everytime I create a new document in Photoshop, it defaults to RGB, and I have to change it manually every time.
    Does anyone know how I can get this to default to my chosen color settings (the Save Preset option when creating New Document also saves size dimensions, which does not work for me) ? Thanks!

    Answer 2: There seems to be no way to uncheck size dimensions when saving the preset. Anything I try remembers dimensions.
    Answer 3: We discussed using an action as a workaround if needed, but were hoping to solve them problem. It's just frustrating because under the Save Preset option, it says "Document profile will default to working space if not included in the saved preset." It's not behaving this way, in fact:
    A.  It does not default to the last options selected in the new dialog window either.
    B.  Also, it does not recognize color settings of my clipboard content (from Illustrator). It defaults to RGB in Photoshop whether I copy/paste from an Illustrator CMYK workspace or RGB workspace.

  • Auto Open New Document Maximised

    Hay all, I am using Photoshop CS2 (9.0.2) on Windows XP (SP2). Whenever I open an image file using PS, the document window constrains itself to the dimensions of the image (IE: if the image file is 20cm X 15cm, the document window opens to 20cm X 15cm dimensions). Can I change it so whenever I open a new document it will automatically maximise the document window?
    Thanks everyone.
    David

    You need to create an action which contains the menu item "View/Fit On Screen". (Use the "Insert Menu Item" option from the actions pallet control menu).
    Once you have the action created and saved, you then need to go to File/Scripts/Script Events Manager.
    In that dialogue you can tell Photoshop to run the action you created every time you open a file.

  • Create settings for a new document

    Here is my problem. When you create a new document in illustrator you have several options available in the new document window. You first can choose web/print/film… and then select a size (A4, A3 for the print, for example) in the second menu.
    I am trying to make my own setting. Making it appears in the first menu is not hard. Just duplicate one of the predefined files and change the name and it appears in the menu presets. Done. But I didn't find a way of changing the sizes option (where I put the arrow). I cannot find anywhere in the predefined document a way of doing this  and to have my own predefined sizes in the second menu instead of the  standard A4, A3… sizes. Anyone might know how to achieve this settings ?  Thanks

    docunagi wrote:
    I am trying to make my own setting.  I cannot find anywhere in the predefined document a way of doing this  and to have my own predefined sizes in the second menu instead of the  standard A4, A3… sizes. Anyone might know how to achieve this settings ?  Thanks
    Ignore the section whcih says "Letter" "A4" or whatever.  You can't change those headings.
    To set your own chosen size, in the boxes which contain width/height dimensions just type in the sizes which you need, and adjust the units if necessary
    Then the bit which says "Letter etc" will just say "Custom"

  • New document units.. Inches not pixels

    Hallo
    How do I make it so a new document in Photoshop uses Inches as its units instead of pixels? I have it set to inches in the preferences -> units & rulers but every time I make a new document it defaults to pixels for the dimensions. Is there a way to make that default to inches?
    Thx
    J

    Every new document has measurements in inches/cm or pixels.
    In the New dialog just change the units to what you want.
    If you choose "Custom" the options stick for next time.

  • JS - Center Selection to Artboard / New Document with certain Artboard size

    TL;DR:
    how do I center my current selection to the artboard?
    just like hitting the "horizontal align-center" and "vertical align-center" buttons.
    Hi,
    I've been searching for the last two hours and before my head hits the keyboard I wanted to ask you for help.
    What I'm struggling with:
    in my init function i create a new document and then copy all layers from the previous document step by step to the new document and then save it as SVG.
    // Init
    (function(){
              destination = Folder.selectDialog('Select folder for SVG files.', docPath);
              if (!destination){return;}
              holderDoc = app.documents.add();
              stepThroughAndExportLayers(docRef.layers);
    my problem is that holderDoc = app.documents.add(); always creates a document that is not the same size as my initial document where the layers get copied from.
    so I want the exact same artboard size as in my initial document.
    I'm fine with either doing it as fixed values or taking directly the values of the inital doc.
    i tried this in the segment where I create the new document:
    // Init
    (function(){
      destination = Folder.selectDialog('Select folder for SVG files.', docPath);
      if (!destination){return;}
      holderDoc = app.documents.add();
      holderDoc.artboards[0].artboardRect = [0,0,128,128];
      stepThroughAndExportLayers(docRef.layers);
    and get this error message:
    "Error 1200: an Illustrator error occured: 1346458189 ('PARM')
    Line: 83
    -> holderDoc.artboards[0].artboardRect = [0,0,128,128];"
    which from what I've read on the web means that illustrator doesnt know what document to pick. but i have called it directly. so what could be the issue?
    to clearify: I do not want to fit the artboard to the images/layer. the artboard should always have a certain size. (for me 128px by 128px)
    I would highly appreciate you helping me with either fixing my approach or propose a completely new one.
    Thanks so much in advance.
    // edit: workaround
    (function(){
              destination = Folder.selectDialog('Select folder for SVG files.', docPath);
              if (!destination){return;}
              var activeArtboard = app.activeDocument.artboards[app.activeDocument.artboards.getActiveArtboardIndex()];
              var ABRect = activeArtboard.artboardRect;
              holderDoc = app.documents.add();
              holderDoc.artboards.add(ABRect);
              holderDoc.artboards.remove(0);
              holderDoc.artboards.setActiveArtboardIndex(0);
              //stepThroughAndExportLayers(docRef.layers);
    i now added a new artboard to the new document with the same size as the artboard on the initial document.
    i remove the predefined artboard on the new doc and set the new artboard as active.
    BUT!
    the artboard is now not centered into the window. which lets illustrator place my image with ctrl+c -> ctrl+v somewhere outside the artboard.
    i now need to align my selection to the center of the artboard. but i cant find any reference on how to center a selection to the artboard.

    yes of course. i never modify the author's comments in original scripts.
    but I wont post the script anywhere when it doesnt work anyway haha.
    this is what I've done now:
    // Init
    (function(){
              destination = Folder.selectDialog('Select folder for SVG files.', docPath);
              if (!destination){return;}
              var activeArtboard = app.activeDocument.artboards[app.activeDocument.artboards.getActiveArtboardIndex()];
              var ABRect = activeArtboard.artboardRect;
              // create new document with same artboard as original
              holderDoc = app.documents.add(DocumentColorSpace.RGB, new UnitValue ((Math.abs(ABRect[0]-ABRect[2])), "px"), new UnitValue ((Math.abs(ABRect[0]-ABRect[2])), "px"));
              stepThroughAndExportLayers(docRef.layers);
    in order to create the new document with the same dimensions as my orignal doc, I first read the artboardRect dimensions of the current artboard and then create the document with those values passed as parameters. the calculation is to get the real width since artboardRect gives you left,top,right,bottom values and not just height and width.
    this only works for square formats though. to make it properly you'd have to change the second "new UnitValue" to use the top and bottom values of artboardRect but I currently dont need to do so.
    * Layers to SVG - layers_export.jsx
    * @version 0.1
    * Improved PageItem selection, which fixed centering
    * @author Anton Ball
    * Exports all layers to SVG Files
    * I didn't want every layer in the SVG file so it first creates a new document
    * and one by one copies each layer to that new document while exporting it out
    * as an SVG.
    * TODO:
    * 1. More of an interface wouldn't hurt. Prefix option and progress bar of some description.
    // Variables
    var docRef = app.activeDocument,
              docPath = docRef.path,
              ignoreHidden = true,
              svgExportOptions = (function(){
                        var options = new ExportOptionsSVG();
                        options.fontSubsetting = SVGFontSubsetting.GLYPHSUSED;
                        options.embedRasterImages = true;
                        options.fontType = SVGFontType.OUTLINEFONT;
                        return options;
              destination, holderDoc;
    // Functions
    var stepThroughAndExportLayers = function(layers){
              var layer,
                        numLayers = layers.length;
              for (var i = 0; i < numLayers; i += 1){
                        layer = layers[i];
                        if (ignoreHidden && !layer.visible){continue;}
                        copyLayerTo(layer, holderDoc);
                        // Resize the artboard to the object
                        selectAll(holderDoc);
                        exportAsSVG(validateLayerName(layer.name, '-'), holderDoc);
                        // Remove everything
                        holderDoc.activeLayer.pageItems.removeAll();
              holderDoc.close(SaveOptions.DONOTSAVECHANGES);
    // Copies the layer to the doc
    copyLayerTo = function(layer, doc){
              var pageItem,
                        numPageItems = layer.pageItems.length;
              for (var i = 0; i < numPageItems; i++){
                        pageItem = layer.pageItems[i];
                        pageItem.duplicate(holderDoc.activeLayer, ElementPlacement.PLACEATEND);
    // Selects all PageItems in the doc
    selectAll = function(doc){
              var pageItems = doc.pageItems,
                        numPageItems = doc.pageItems.length;
              for (var i = 0; i < numPageItems; i += 1){
                        pageItems[i].selected = true;
    // Exports the doc to the destination saving it as name
    exportAsSVG = function(name, doc){
              var file = new File(destination + '/' + name + '.svg');
              holderDoc.exportFile(file, ExportType.SVG, svgExportOptions);
    // Makes sure the name is lowercase and no spaces
    validateLayerName = function(value, separator){
              separator = separator || '_';
              //return value.toLowerCase().replace(/\s/, separator);
              return value.replace(/\s/, separator);
    // Init
    (function(){
              destination = Folder.selectDialog('Select folder for SVG files.', docPath);
              if (!destination){return;}
              var activeArtboard = app.activeDocument.artboards[app.activeDocument.artboards.getActiveArtboardIndex()];
              var ABRect = activeArtboard.artboardRect;
              // create new document with same artboard as original
              holderDoc = app.documents.add(DocumentColorSpace.RGB, new UnitValue ((Math.abs(ABRect[0]-ABRect[2])), "px"), new UnitValue ((Math.abs(ABRect[0]-ABRect[2])), "px"));
              stepThroughAndExportLayers(docRef.layers);

Maybe you are looking for