Applescript use Document size information

HI ALL,
I am trying to put together a script that would fill up a slug with document size information:
- Let say my document is 8.5"W x 11" H
- Let say that my slug has a "document size" area with placeholder text, like DocWidth x DocHeight
The script would do a find and replace of "DocHeight" by the value of the Height of my document.
Here is an abstract of my applescript as it stands:
......... (there is more before this section: I set document size to a random size, 6"x6", then tells it to put some bleed, then a slug area, then to import my slug that is a snippet)
tell application "Adobe InDesign CS4"
    set myWidth to page width of document preferences of myDocument
    set myHeight to page height of document preferences of myDocument
    set find text preferences to nothing
    set change text preferences to nothing
    set find what of find text preferences to "DocHeight"
    set change to of change text preferences to myHeight
    tell active document
        set myFoundItems to change text
    end tell
end tell
Now my script works, but it gives me the following error:
Adobe InDesign CS4 got an error: Invalid value for set property 'change to'. Expected string or nothing, but received 6.0.
Does anyone know waht I am missing here ?
Thank you for any help!!!!

Change to wants text, not a number. Try:
    set change to of change text preferences to (myHeight as text)
I'd also want to focus that find/change just on the slug area. So if it's in a text frame called "Slug", you'd do something like:
  set myFoundItems to change text parent story of text frame "Slug"
Shane Stanley <[email protected]>
AppleScript Pro, April 2010, Florida <http://www.applescriptpro.com>

Similar Messages

  • Get empty document size information?

    Hi,
    I need to identify the empty tif files(that is the file which have no data(empty document size)) using scripting. Kindly advise me how to get the information using scripting.
    Thanks for looking into this.

    // select files;
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}
    else {var theFiles = File.openDialog ("please select files", getFiles, true)};
    if (theFiles.length > 0) {
              var theArray = new Array;
              for (var m = 0; m < theFiles.length; m++) {
                        theArray.push(theFiles[m].name+" is "+theFiles[m].length+" bytes")
              alert (theArray.join("\n"))
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true

  • Use document size/PDF TrimBox as a label

    Hello. I have found the SizeLabels.jsx by Jongware and it's very close to what I want. It is putting a label, but it's using the size of the image in InDesign. I would like it to put the size of the placed file. And in the case of PDFs, put the size of the TrimBox. If I have to choose one or the other...I need the PDF TrimBox size. I am very new to InDesign scripting. Can someone help me please? Thanks.
    InDesign CC on Mac OSX Mavericks

    Menu > File > Export > Word or PDF
    Peter

  • Using Scripts to detect document size in inches?

    Is it possible that a script detects the document size in inches not in pixels?
    Thanks for the help!

    The size an Image will print is a simple calulation the numbet of Pixel Wide Devided by the imageg current DPI resolution. And numbet of Pixel High Devided by the imageg current DPI resolution. You can always change the DPI while maintaining the same number of pizels using Image Size with resample NOT checked to change the image's print size. All the information can be retrived in a script and the script can change the image's print size with or without resampling the image.

  • Hello ! how to change document sizes and use our own size (not A3, A2 ...) thank you !

    hello ! how to change document sizes and use our own size (not A3, A2 ...) thank you !

    Experiment. No harm in trying.
    If you are just starting to use Pages you need to make your own assessment given current events whether committing your work to a format and software given this support is a wise move.
    You also need to look at what will produce workable results. Particularly if your large posters are to be commercially printed and contain large bitmap (photographic) images.
    Always work backwards from your output. Ask your printer what they require to do their job.
    Peter

  • Export to PDF ignores document size settings?

    I have several documents in InDesign CS4 and when I export them to PDF the document size changes.
    I have set all the following options to A4 (210x297mm):
    In Indesign: File->Document Settings
    In Windows->Printer settings->Adobe PDF->Paper Size
    After exporting and opening in Reader 9 the document size has changed to 210 x 303.3mm
    This then requires a tweak before the first print run.
    I should be able to just export to production and they can print from the PDF without checking the settings!
    What have I missed?

    I am using the export option not printing to PDF.
    The summary reads as follows
    Description
        [Based on 'Box Labels'] [Based on '[High Quality Print]'] Use these settings to create Adobe PDF documents for quality printing on desktop printers and proofers.  Created PDF documents can be opened with Acrobat and Adobe Reader 5.0 and later.
    PDF Preset: Box Labels
    Compatibility: Acrobat 8 (PDF 1.7)
    Standards Compliance: None
    General
        Pages: All
        Spreads: Off
        Generate Thumbnails: Off
        Optimise PDF: Off
        Create Acrobat Layers: Off
        Export Layers: Visible Layers
        Include Bookmarks: Off
        Include Hyperlinks: Off
        Export Nonprinting Objects: Off
        Export Visible Guides and Baseline Grids: Off
        Create Tagged PDF: Off
        Include Interactive Elements: Off
        Multimedia: N/A
    Compression
        Colour Images
            No Sampling Change
            for images above: 450 ppi
            Compression: None
            Tile Size: N/A
            Quality: None
        Greyscale Images
            Bicubic Downsample at: 300 ppi
            for images above: 450 ppi
            Compression: Automatic
            Tile Size: N/A
            Quality: Maximum
        Monochrome Images
            Bicubic Downsample at: 1200 ppi
            for images above: 1800 ppi
            Compression: CCITT Group 4
        Compress Text and Line Art: On
        Crop Image Data to Frames: On
    Marks and Bleeds
        Crop Marks: Off
        Bleed Marks: Off
        Registration Marks: Off
        Colour Bars: Off
        Page Information: On
        Page Mark Type: Default
        Weight: 0.25 pt
        Offset: 2.117 mm
        Use Document Bleed Settings: Off
        Bleed Top: 0 mm
        Bleed Bottom: 0 mm
        Bleed Left: 0 mm
        Bleed Right: 0 mm
        Include Slug Area: Off
    Output
        Colour Conversion: No Colour Conversion
        Destination: N/A
        Profile Inclusion Policy: Include RGB And Tagged Source CMYK Profiles
        Simulate Overprint: N/A
        Output Intent Profile Name: N/A
        Output Condition: N/A
        Output Condition Identifier: N/A
        Registry Name: N/A
    Advanced
        Subset Fonts Below: 100%
        Omit PDF: Off
        Omit EPS: Off
        Omit Bitmap Images: Off
        Transparency Flattener Preset: N/A
        Ignore Spread Overrides: N/A
    Security
        N/A
    Warnings

  • What's my document size?

    My PS4 document size indicates 4/12 MB, yet in the finder, 21 MB.
    Which one is accurate?  I am trying to condense stuff for disk burns.
    Here's one that says 8/13 in PS4, but a whopping 41 MB in the finder !
    Bridge says 41 also.
    Much prefer be at 8 or 13.

    As Wade has already commented the file size is the space it takes up on the disk or hard drive. By using compression you can change this size with certain formats. Jpeg has 12 levels of compression but as I'm sure you know is a lossy format. With Jpeg the lower the number the higher the compression (smaller file) but also more data loss.
    Tiff can also be compressed. Tiff compression is lossless. PSDs have there own compression RLE I believe, this is set and can't be turned on or off.
    As far as the sizes at the bottom of the window. If you control click you have many choices of information. for document size the left represents the printing size of the image—approximately the size of the saved, flattened file. The number on the right indicates the file’s approximate size, including layers and channels.
    You can find this info and much more here http://help.adobe.com/en_US/Photoshop/11.0/WSfd1234e1c4b69f30ea53e41001031ab64-7508a.html in the CS4 help files.

  • Document size performance considerations

    We are trying to determine the performance implications of different approaches to document storage with BDB. Most of the XML we need to store will contain anywhere between 5000 to 20000 nodes at about 6MB per XML block. Best practices or document size analysis/data breakdown isn't a topic that is well explained on the docs websites. We are working primarily in a single-threaded environment.
    1. Does performance degrade considerably when BDB containers hold documents upwards of 500MB? 2GB? or should documents generally be small? (Assuming Node type storage)
    2. Does anyone know of or have any best practices for data breakdown and storage within BDB?
    And completely unrelated:
    3. Are Environments completely portable when fully moved to different systems?
    Many thanks.

    Hi Taka,
    1. Does performance degrade considerably when BDB
    containers hold documents upwards of 500MB? 2GB? or
    should documents generally be small? (Assuming Node
    type storage)Documents being written need to be parsed (larger docs take longer), inserted into the database and the appropriate indices updated (the more indices, the longer it takes). I think that the best thing to do is to build a prototype of your application, populate a database and benchmark the performance.
    3. Are Environments completely portable when fully moved to different systems?There are two issues with copying or moving databases: database page log sequence numbers (LSNs), and database file identification strings.
    Because database pages contain references to the database environment log records (LSNs), databases cannot be copied or moved from one transactional database environment to another without first clearing the LSNs. Note that this is not a concern for non-transactional database environments and applications, and can be ignored if the database is not being used transactionally. Specifically, databases created and written non-transactionally (for example, as part of a bulk load procedure), can be copied or moved into a transactional database environment without resetting the LSNs. The database's LSNs may be reset in one of three ways: the application can call the DB_ENV->lsn_reset method to reset the LSNs in place, or a system administrator can reset the LSNs in place using the -r option to the db_load utility, or by dumping and reloading the database (using the db_dump and db_load utilities).
    Because system file identification information (for example, filenames, device and inode numbers, volume and file IDs, and so on) are not necessarily unique or maintained across system reboots, each Berkeley DB database file contains a unique 20-byte file identification bytestring. When multiple processes or threads open the same database file in Berkeley DB, it is this bytestring that is used to ensure the same underlying pages are updated in the database environment cache, no matter which Berkeley DB handle is used for the operation.
    The database file identification string is not a concern when moving databases, and databases may be moved or renamed without resetting the identification string. However, when copying a database, you must ensure there are never two databases with the same file identification bytestring in the same cache at the same time. Copying databases is further complicated because Berkeley DB caches do not discard cached database pages when database handles are closed. Cached pages are only discarded when the database is removed by calling the DB_ENV->remove or DB->remove methods.
    Bogdan Coman

  • A PDF document with information about activation for CS6 software

    Here's a PDF document with information about activation for CS6 software.
    I found it very useful for understanding how the system worked for activation of perpetual licenses, both in cases where the computer is and isn't connected to the Internet.

    Ann, with some browsers, the PDF document will download in the background rather than appear in a browser window.

  • How to change Default document size for CC Library Graphics (InDesign)

    Good morning --
    I have just discovered the amazing uses of the CC Library setup in InDesign and would love to be able to use it as a tool to collaborate template galleries amongst coworkers.
    I work in an industry that offers many different templates for our Marketing pieces available to the sales team. What we have in place right now is about 50+ different templates in their own packaged files. Now, this isn't all that difficult to maneuver around, but the CC Library has made it so I can "drag and drop" templates into place. This drag & drop feature is easy enough for me to grasp, and with the proper training it should be with the rest of the team (should being the keyword). However, in some cases if you double-click on Library graphic it opens the file in it's own editable file with a custom document size of 8.5x11 Portrait (which I imagine to be the internal InDesign preset).
    My questions therefore are when I double click on the library "Graphics" can the document size be anything other than 8.5x11? Can each Graphic have it's own document preset?
    - If I open a file that is set for landscape, all of the "Graphic" falls off of the spread.
    - Some "eblasts" are much longer than 8.5x11 (sometimes as much as 8.5x20), thus knocking some of the "Graphics" into that weird space area.
    Please let me know if I am not being a clear enough.
    Thank you!
    Steve

    @Steve – you are totally clear what you are doing and what you like to do.
    But I fear an automatic setting that is creating the page size according to an asset's size does not exist right now.
    I can change the size of a new document beforehand, if no document is open and create a new size in the document's properties dialog with the keyboard shortcut alt + cmd + p (in my German InDesign on Mac OSX 10.7.5). But you have to know in advance what size that should be.
    Example: If I chose A3 instead of A4 (my default) when no document is open and double click an asset in a CC Library the asset will be placed in a one page document sized A3.
    1. Changing the size (no document is open) in my German UI of InDesign CC-2014.2:
    2. Double click and the result is according to the settings I made:
    Uwe

  • HT201342 how can I retrieve my old files on important  and documents?informations

    How can I retrieve my old files on important documents and informations?

    Contacts and calendars are designed to be synced with a supported application on the computer or a cloud service like iCloud, Google, or Exchange.
    Has the device been used as designed?  If so, simply re-sync them.
    Did you actually allow the device to finish restoring after installing the update?

  • Copy & Paste From Illustrator to Photoshop not matching document size

    I just recently reformated my computer and I've been having an issue with copy and paste from Illustrator to Photoshop. Before I could copy a 2"x2" vector box from Illustrator into photoshop making a new document and the size and resolution would match. That is the new document would say 2"x2" at 300 ppi in photoshop and the preset would read "clipboard". I would then hit ok and paste and it would match perfectly. Now since I've reformated, photoshop always creates a new document with the wrong size regardless of the settings I enter in Illustrator or photoshop. I have document raster and effects set at 300 ppi in Illustrator and I have the new document set at 300 in photoshop, but it always transfers the 2"x2" box as some other size no matter what resolution I change it too. Again this used to work before so I'm assuming there is some setting I forgot about. Does anyone know? The main issue is the clipboard preset is not matching the document size, its almost as if Illustartor is telling photoshop it's a different resolution when it's not. Copying to 72 ppi seems to have no issue, which makes me think Illustrator just isn't sending it out at 300 ppi, but I don't know why as I have the document set at 300 ppi.

    Have you found an answer that wasn't posted here yet? I have the same issue.

  • Changing Resolution and Document size

    Hello - I have a jpeg from a digital camera that I Saved As photo.psd with an original Document Size of 44" x 66" @ 72 ppi resolution.
    I am using CS3 and I want to prepare the photo for printing while maintaining the highest quality possible. The first thing I did was uncheck Resample Image. Then I changed the resolution to 300. This gave me a Document Size of 10.56 x 15.84.
    I want to enlarge the Document Size to 16" x 24" (the same proportions). So, it seems to me that the next step is to now check Resample Image and put in my new Document Size of 16" x 24". I would then apply some Unsharp Mask as desired.
    So, should Ifollow the steps above or do you recommend a different workflow?
    I've read that Photoshop will upres very well up to 200% and all I need is 166%, so it should work ok. Also, do you recommend standard Bicubic or Bicubic Smoother?
    TIA

    What you're suggesting will work, though you don't really need to do it in multiple steps.  One step, with resampling checked, once you set all the fields as you want, will do the trick.
    And for all the hype and mystery surrounding the two alternate choices for resampling, in all my work for minor resampling I always find I prefer Photoshop's original Bicubic method.  For extreme upsampling I prefer, personally, a plug-in called Genuine Fractals.
    Also, modern print drivers are getting very good at size matching...  If the image quality in your file is to your liking, you COULD just set the print size in inches (without resampling) and be done with it.  This would yield an image at a resolution lower than 300 pixels/inch, but would save you some work, and it may very well be that you will not be able to see any difference by letting the driver do the resampling as needed.
    -Noel

  • Can't use "read the information"

    hello every body
    first excuse my english... I'm french and my studdies are far...
    I can't use "read the informations" .
    When I try, nothing appens and within a few seconds, the finder restarts.
    if I did something wrong, I did it on my two computers (pb G4 ti and imac G5) same problem on both...
    thank you for your answers...

    You will be able to the get this information using the VISA Driver Development Wizard. You can read more about this tool at the following link:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/ADF3152837E2B4A486256B5600642AC7?opendocument
    This document explains in detail the process required.

  • Document Size v Paper Size

    I am using Acrobat Pro 8 with a HP 3050 all in one. I am attempting to print two forms I created from scanned images (that have form fields) that are irregular sizes. I am only printing the form fields and not the scanned image, so my print setting is set to "form fields only".  However, my form fields are not aligning with the documents I am feeding through the printer and I've noticed that there is a "document" size and "paper" size of two different sizes in the printer dialog box and have no idea why.
    For example, at the bottom right of the print dialog box, the paper size says 7.0" x 3.4" (the correct/actual size) but the document size is saying 7.5 x 3.9 (not sure where this size is coming from). When I use the rulers to measure it in Acrobat, it says 7.0" x 3.4", yet when I print it out, the text is out of alignment and treating the document as if it is 7.5 x 3.9. The same thing happens with another document that I'm attemping to do the same thing with.  In the print dialog box, the document size is saying 5.5" x 3.1" and the paper size is saying 5.8 x 3.9.
    Is there any way to over ride or change this? I suspect it's somehow due to the HP print driver.  If there's an alternative to accomplish what I'm doing, I'm open to any suggestions. I am using preprinted forms that I'd like to have fed in the printer. I don't necessarily want to re-create them in InDesign or Illustrator (I originally scanned the forms using Acrobat).
    Thank you.

    @Bill@VT - Sorry, that didn't work with either form I'm using. It is not allowing me to enter a custom size. It is
    defaulting to a 8x13 (custom) size.

Maybe you are looking for

  • Problem with printing an individual PDF

    We have a document that we are trying to print from one of the workstations and it will not print.  I looked at the properties for this document and the application is "Supervisor 7.0.0".  Not sure what this is.  The other PDF's are not coded this wa

  • What is the best car kit for 3g transmission and charging

    give some options - what is out there?

  • How to extend a class from super package?

    Say I have a dir a\ in dir a\ there is a dir b\ in b\ there is a class called DerivedClass in a\ there is a class called ExtendedClass how do I extend ExtendedClass from DerivedClass?

  • TV miglia max and iMac G4: problems

    Hi all, I have a problem with my Mac G4 1Ghz. I brought the new Tv Miglia Max but I can't install it( it doesn't finish the guided installation). My model should have 3 USB 2.0 ports but it seems the computer doesn't "see" tv miglia Max. Someone coul

  • Hangs and The ball spins unless I uninstall flash elements shockwave

    I have an iMac 2.66 GHz Intel Core 2 Duo. 10.6.6. 4Gb ram. 320 hard drive only used about 50GB of it. I've been using it fine until about november 2010. Spinning BeachBall - system holds - cannot close down force quit - happens constantly and so i ..