Setting width of a new document

Evening all, I am trying to set up an AppleScript that opens a new document 100 pixels by 100 pixels. But when I try the code below, it opens a document 100 inches wide. How do I set the size to pixels?
My code:
make new document with properties {height:100, width:100}
I've tried specifying that as 100px or 100 pixels, but neither of them worked. Any ideas?

Actually, I figured out that I had not set the ruler units correctly, and the program was defaulting to inches. I added these two lines at the top of the script and they fixed it:
tell application "Adobe Photoshop CS4"
-- set the units to pixels
set ruler units of settings to pixel units
set type units of settings to pixel units

Similar Messages

  • [AS][CS5] Duplicate selection to new document

    Hi everyone,
    I'm working on a script that will allow me to make a PDF or printout of a selection in InDesign by duplicating the selection to a new document.
    I'm having difficulty with the portion of the script that duplicates the selection to a new document.
    I'm trying to follow the instructions in the CS5 scripting guide but it's not working.
    Here's my code:
    --make a new document from selection
    tell application "Adobe InDesign CS5"
        set mySelection to selection
        if (count of mySelection) = 0 then
            display dialog "Nothing selected." & return & "Select something and then run the script." buttons {"OK"} cancel button {"OK"}
        end if
        tell document 1
            --make group in order to get width/height of selection
            if (count of mySelection) > 1 then
                set myItem to make group with properties {group items:(mySelection)}
            else
                set myItem to item 1 of selection
            end if
            set theBounds to geometric bounds of myItem
            set theHeight to (item 3 of theBounds) - (item 1 of theBounds)
            set theWidth to (item 4 of theBounds) - (item 2 of theBounds)
            --undo the grouping so selection is unchanged
            undo
        end tell
        --make new document sized to the width/height of the selection
        set myDoc to make new document with properties {document preferences:{page width:theWidth, page height:theHeight}}
        --duplicate selection to new document
        tell mySelection
            set myDupe to duplicate to page 1 of myDoc
        end tell
    end tell
    I get the following error:
    {«class crec» id 201 of «class sprd» id 186 of document id 2 of application \"Adobe InDesign CS5\", «class crec» id 202 of «class sprd» id 186 of document id 2 of application \"Adobe InDesign CS5\", «class crec» id 207 of «class sprd» id 186 of document id 2 of application \"Adobe InDesign CS5\"} doesn’t understand the duplicate message." number -1708 from {«class crec» id 201 of «class sprd» id 186 of document id 2, «class crec» id 202 of «class sprd» id 186 of document id 2, «class crec» id 207 of «class sprd» id 186 of document id 2}
    Thanks!

    Alison, you just have a minor omission… You have not declared your object to dupe… This worked with a little tweek…
    --make a new document from selection
    tell application "Adobe InDesign CS5"
    set mySelection to selection
    if (count of mySelection) = 0 then
    display dialog "Nothing selected." & return & ¬
    "Select something and then run the script." buttons {"OK"} cancel button {"OK"}
    end if
    set openDoc to document 1
    tell openDoc
    --make group in order to get width/height of selection
    if (count of mySelection) > 1 then
    set myItem to make group with properties ¬
    {group itemsmySelection)}
    else
    set myItem to item 1 of selection
    end if
    set theBounds to geometric bounds of myItem
    set theHeight to (item 3 of theBounds) - (item 1 of theBounds)
    set theWidth to (item 4 of theBounds) - (item 2 of theBounds)
    end tell
    --make new document sized to the width/height of the selection
    set myDoc to make new document with properties ¬
    {document preferences:{page width:theWidth, page height:theHeight}}
    --duplicate selection to new document
    tell openDoc
    set myDupe to duplicate myItem to page 1 of myDoc
    --undo the grouping so selection is unchanged
    undo
    end tell
    --re-posistion in new size doc
    tell myDoc
    move myDupe to {0, 0}
    end tell
    end tell
    Sorry I've forgotten where you turn off the Emoticons… dammed : + (

  • Indesign CS2 "selection to new document" script?

    Hi, just changing over to Indesign CS2 (i know! should be cs5 soon apparently), and noticed the scripting seems to be quite powerful with this software, i dont suppose anybody has created a script that would paste the currently selected object into a new document?  Would be handy when we're making templates for a self-build system to make it all on one document, then paste the various size boxes onto new documents ready to configure and upload!

    Alison, you just have a minor omission… You have not declared your object to dupe… This worked with a little tweek…
    --make a new document from selection
    tell application "Adobe InDesign CS5"
    set mySelection to selection
    if (count of mySelection) = 0 then
    display dialog "Nothing selected." & return & ¬
    "Select something and then run the script." buttons {"OK"} cancel button {"OK"}
    end if
    set openDoc to document 1
    tell openDoc
    --make group in order to get width/height of selection
    if (count of mySelection) > 1 then
    set myItem to make group with properties ¬
    {group itemsmySelection)}
    else
    set myItem to item 1 of selection
    end if
    set theBounds to geometric bounds of myItem
    set theHeight to (item 3 of theBounds) - (item 1 of theBounds)
    set theWidth to (item 4 of theBounds) - (item 2 of theBounds)
    end tell
    --make new document sized to the width/height of the selection
    set myDoc to make new document with properties ¬
    {document preferences:{page width:theWidth, page height:theHeight}}
    --duplicate selection to new document
    tell openDoc
    set myDupe to duplicate myItem to page 1 of myDoc
    --undo the grouping so selection is unchanged
    undo
    end tell
    --re-posistion in new size doc
    tell myDoc
    move myDupe to {0, 0}
    end tell
    end tell
    Sorry I've forgotten where you turn off the Emoticons… dammed : + (

  • Change default magnification of new documents?

    When I have a document displaying at 100% on my 24" iMac, it doesn't display at anywhere near 100%. This can be proven by holding up a piece of paper next to the display. An AppleWorks document set up as 8 1/2 x 11 in Page View has to be magnified to about 130% to be the same size onscreen as an actual 8 1/2 x 11 document.
    Why is this? Is it because of the higher resolution of the monitor? I still don't see why this should matter. Actual size should mean actual size.
    This being the case, is there any way to set AppleWorks so that new documents will be displayed at 130% by default?

    AppleWorks was originally written to display at 100% on a screen with a fixed dot pitch of 72 dpi. The code to accommodate a variety of screen resolutions was never implemented (and probably never written).
    You can create a default template with your own parameter settings, including default magnification.
    Open a new word processing document and set the parameters as you want them to be, then press command-S.
    Click the Template radio button at the bottom of the Save dialogue. AppleWorks will navigate to the Templates folder where this should be saved.
    Name the document "AppleWorks WP Options" (without the quotes). AW will supply the correct extension.
    Click Save.
    New WP documents will adopt the parameters you set for this template.
    The process is similar for other types of AW documents; substitute the two letter code that shows in the title bar for "WP" in the instructions above.
    Regards,
    Barry

  • Setting english as the default language for a new document with arabic version of CC apps

    first off, appologies for the screen name, the name i'm sure i had registered before with account was suppose dot be looged in as was barred, so i used this in frustration.  Read the book, The Etymologicon to learn more.
    and another note.  why is the font size in the subject on this form gigantic? intentional of cockup?
    Now, to the point.
    Please please enlighten me, I'm sure it's simple but i can't find the answer and have been haphazardly ploughing the net for half the night.
    I have installed the Arabic langauge version of CC software becuase i need to do a lot of bilingual layouts.
    But
    I generally use, and start with english, but the defualt new document is always set to all the arabic settings, which is a nightmare.
    How do i make english the defualt type (and all the paragraph and language options) while retaining the functionaility of arabic version. 
    I've found instructions for CS2-6 but nothing remotely sensible about CC, and presume i'm missing something really really obvious.

    Hi,
    Here you have some interesting tutos about foreign languages in LV :
    Localizing Your LabVIEW Application to Different Languages
    Localize LabVIEW Applications in Multiple Languages
    Let me know what happens.
    Regards,
    Message Edité par Steve Mohamed le 02-27-2009 09:02 AM
    Steve M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Vidéo-t'chats de l'été : présentations techniques et ingénieurs pour répondre à vos questions

  • When i open a new document, my "width" and "lenght" add two zeros automatically to file size??? For example basic A4 size in mm is 210 00mm x 297 00mm? And i can´t do nothing about it! Why on earth?

    When i open a new document, my "width" and "lenght" add two zeros automatically to file size??? For example basic A4 size in mm is 210 00mm x 297 00mm? And i can´t do nothing about it! Why on earth?
    This "error note" must have something to do about it?

    elppaelo,
    You may try the list.
    The following is a general list of things you may try when the issue is not in a specific file (you may have tried/done some of them already); 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save curent artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to 3 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • How do I set up new Document Profile with custom page sizes?

    I see that different profiles have different sets of page sizes. I need a set of page sizes which I use often, and I would like to create a set of these sizes in a new profile, or at least somehow add them to the very minimal set of page sizes which can be selected when setting up a new document. Can this be done?

    Thanks Jerron, I have done this but it only adds one document at one size to the list of presets. The list of sizes that comes with it is the same as the preset it was created from originally. What I would like to do is add to the list of sizes which comes with any one of the document presets or create a new one with a new list of sizes.

  • New Document set-up

    I am puzzled by a feature in InDesign CS2 version 4.0.5 that I have never seen before. I am using a Mac that is is another department at my workplace and when you are creating a new document in the File>New dialog box, this is what you get: Width, Height, Number of columns (all normal). But under the window to designate the number of columns, there is a window requiring the width of the columns. Where did that come from and how can I get rid of it? It is presenting major layout problems.

    When you say "....but under the window to designate the number of columns, there is a window requiring the width of the columns", do you mean Text Frame Options? It has nothing to do with those columns you define in New Document window.
    Those are two different ways to define columns. In New Document window (or Layout>Margins&Columns) you define columns to page, in Text Frame Options you define columns to text frame. There are no width value when you define columns for page. If you define columns for text frame, you can define width for columns if you like.

  • Set up a new document to print

    I'm new to InDesign. Loved PageMaker! I need to set up a document for an elementary school yearbook. In PageMaker I set it up as a Letter size single pages and then I asked to build a booklet, printing to 11 x 17 paper. How do I set up to print a booklet on 11 x 17 in InDesign? Please help!

    See:
    How to use multiple iPods, iPads, or iPhones with one computer
    What is the best way to manage multiple...: Apple Support Communities
    If you want all the same setting like mail a then restore the new iPod from the backup of the old one. Otherwise, set it up as new and sync what you want.To restore from backup see:
    iOS: How to back up

  • Don't want column width in new document window

    Suddenly, and I can't determine why, my InDesign CS2 has started putting column width as an option in the New Document window. It didn't used to do that. I don't want that to be there. Anyone have any suggestions?

    You must have some sort of plugin installed from a third party

  • Error in setting the linenum for new expenses document

    Hi all,
    I have created an add-on procedure to add a new expenses document to a selected service call.  Although the code compiles without any errors, when I go back and check the expenses tab in the service call form, the new document doesnt appear in the expenses grid.  I also checked whether the data was saved into the corresponding SCL2 and SCL4 tables.  The new stock transaction is not saved into the service call.  My current code is:
    Public Sub add_StockTransaction(ByVal strGRJobID As String, ByVal srtSTDocNo As String)
            Dim oServiceCall As SAPbobsCOM.ServiceCalls
            Dim oExp As SAPbobsCOM.ServiceCallInventoryExpenses
            Dim bRetVal As Boolean
            Dim errcode As Long
            Dim errmsg As String
            Try
                oServiceCall = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oServiceCalls)
                bRetVal = oServiceCall.GetByKey(strGRJobID)
                If Not bRetVal Then
                    SBO_Application.MessageBox("Failed to Retrieve the record.")
                    Exit Sub
                End If
                oExp = oServiceCall.Expenses
                oExp.Add()
                oExp.DocumentType = "67"
                oExp.DocumentNumber = strSTDocNo
                oExp.DocEntry = strSTDocNo - 99999
                SBO_Application.MessageBox(oExp.LineNum)
                oExp.SetCurrentLine(oExp.LineNum + 1)
                oExp.StockTransferDirection = 1
                oExp.Add()
                oServiceCall.Update()
                bRetVal = oServiceCall.Update()
                If bRetVal = False Then
                    oCompany.GetLastError(errcode, errmsg)
                    SBO_Application.MessageBox(errmsg)
                Else
                    SBO_Application.MessageBox("Successfully added stock transaction to Service Call.")
                End If
            Catch ex As Exception
                SBO_Application.MessageBox(ex.Message)
            End Try
    end sub
    I would appreciate any help as I tried so many ways of solving the problem but couldn't find a solution.  Thank you all in advance.

    Bingo.... I got it.
    Thanks for your hint about the ./.profile. I was setting env variables in .cshrc file and my default shell for "oracle" user was sh.
    Then I changed the default shell for oracle user to csh and viola..... it works.
    root@zngds1gk # su - oracle
    $ id
    uid=100(oracle) gid=101(dba)
    $ setenv
    HOME=/space/oracle
    PATH=/space/oracle/app/oracle/product/10.2.0/Db_2/bin:/usr/bin:
    LOGNAME=oracle
    HZ=100
    TERM=xterm
    SHELL=/bin/sh
    $ exit
    root@zngds1gk # usermod -u 100 -s /bin/csh oracle
    root@zngds1gk # su - oracle
    zngds1gk%
    zngds1gk% setenv
    HOME=/space/oracle
    PATH=/space/oracle/app/oracle/product/10.2.0/Db_2/bin:/usr/bin:
    LOGNAME=oracle
    HZ=100
    TERM=xterm
    SHELL=/bin/csh
    zngds1gk% cat .cshrc
    umask 022
    setenv ORACLE_BASE /space/oracle/app/oracle
    setenv ORACLE_SID adm
    setenv DISPLAY 47.102.212.108:0.0
    setenv ORACLE_HOME /space/oracle/app/oracle/product/10.2.0/Db_2
    setenv PATH /space/oracle/app/oracle/product/10.2.0/Db_2/bin:$PATH
    And now it works...
    Thanks.
    ~Jayant

  • Set the height and width of a new browser window

    I am trying to open a new browser window when the user clicks
    on an audio. The audio will be played in the new browser window.
    The only problem I have is that I cannot set the height and width
    of the new browser window. I need the window to be much smaller.
    How can I do this in flash?

    You need to ask on a JavaScript forum. Java != JavaScript

  • InDesign CS2 Setting up a new document

    When opening a new document how do you get three pages to view in the page layout? (For instance when creating a six page folder.)

    In the pages panel, disable allow pages to shuffle. Then just drag the
    pages to the spread you want them to be part of.
    It's a bit tricky but you'll get the hang of it.
    Bob

  • New document - changing the displayed unit in width/height?

    Hi all,
    Sorry for this basics question relating to InDesign CS5...
    When creating a new document, with a custom size, the default size is showing as XXp00 - I don't know what the 'p' means nor it's relation to other units such as cm or mm.
    Is there a way for the default to be cm, or mm?

    XXpYY is the established convention for displaying picas (6th of an inch) and points (12th of a pica). 3p0 is 3 picas,0 points, or half an inch. 13p6 is 13 picas, 6 point, or 2.25 inches.
    You can type any units you like in any dialogue or panel and InDesign will handle the conversion to the currently displayed units. If you want a page 14 inches wide, just type 14" and InDesign will accept that and display it as 84p0.
    You cannot change the default units while a modal dialogue (like New Document) is open. You can change the default units in Preferences. You can also change the displayed units in the current document by right-clicking on the ruler. Each ruler remembers its own units, so either change the units for both rulers or right-click on the intersection of the rulers at the top left of the window.

  • How do I create a new document in Photoshop CC and have it 300 dpi?

    How do I create a new document in Photoshop CC and have it 300 dpi? I am doing digital scrapbooking and need to have my layout in Photoshop 12 x 12 so it is a scrapbook page and 300 dpi and I hope this doesn't sound stupid but I don't even know what dpi means.
    Thank you

    File>New
    Set preset to print or US Paper
    (typing width and height values will change the preset to custom)
    Set width to 12 inches
    set height to 12 inches
    set ppi to 300 (should already be this if you used the print preset)
    Click OK

Maybe you are looking for

  • Sales order field Non Editable

    Dear All, how to make  sales order field -payment terms non editable to the end  users we do not want the endusers to change the payment terms proposed from the customer master With regards Mohammed Raees

  • White Scratch Marks Appear When Saving Extracted hair as GIF

    Hi guys, I need your help with a problem that has been driving me up the wall. I've created a web site (my first) for my sister and it's all ready to be uploaded. But I've been held up for a while by a Photoshop problem. I've been trying to extract a

  • Open With Context Menu acting up

    It seems as if using Time machine allows old versions of applications to appear in the "open with" menu. Is that sensible? How can I turn it off? I don't really want to mistakenly open files in old versions of applications....

  • Making a component half way transparent(not fully opaque or nuopaque)

    Is it possible to make a component (frame, panel etc) half way transparent, I know that its possible to make it fully transparent but i would like to know of a way to go half way, thanks.

  • Rules Engine

    Hi, I am evaluating some rules engine to embedd within the existing project. I am looking at JESS but could not understand how it works. I am looking at a core Rule engine with an API that i can be included within the project class path and build a G