Script for export from eps to jpg done. Just need to know jpg pixel dimensions?

i have a script which export eps to jpg using below script (width is always 1276 px). Is there any way to know the dimension of the each jpg files as an alert?
#target illustrator
var i,  files, sourceDoc, targetFile;
files = File.openDialog ("Hi, Please select EPS file(s)", /.eps$/, true);
try
if (files.length > 0)
  for ( i = 0; i < files.length; i++ )
        sourceDoc = app.open(files[i]);
        var myVisibleBounds = sourceDoc.visibleBounds;
        myVisibleBounds[0] = myVisibleBounds[0] - 1;  // left
        myVisibleBounds[1] = myVisibleBounds[1] + 0.5;   // top
        myVisibleBounds[2] = myVisibleBounds[2] + 1;   // right
        myVisibleBounds[3] = myVisibleBounds[3] - 1 ;    // bottom
        sourceDoc.artboards[0].artboardRect = myVisibleBounds;
//        var docLeft = sourceDoc.artboards[0].artboardRect[0] - 50;
//        var docTop = sourceDoc.artboards[0].artboardRect[1] + 50;
//        var docRight = sourceDoc.artboards[0].artboardRect[2] + 50 ;
//        var docBottom = sourceDoc.artboards[0].artboardRect[3] -50 ;
        var sourceDocWidth = Math.round(myVisibleBounds[2] - myVisibleBounds[0]);
//        var sourceDocHeight = docTop - docBottom;
        var myZoom = (1276/sourceDocWidth) * 100;
//        alert(sourceDocWidth + " Math round: " + Math.round(sourceDocWidth) + "   " + myZoom);
        targetFile = getNewName();
   // Call function getPDFOptions get the PDFSaveOptions for the files
        exportOptions = exportJPEG( );
   // Save as pdf
   sourceDoc.exportFile (targetFile, ExportType.JPEG, exportOptions);
   sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
  alert( "Done" );
catch(e)
    alert(e +  "\r" + "No files selected");
function getNewName()
var ext, docName, newName, saveInFile, docName;
docName = sourceDoc.name;
//ext = '.pdf'; // new extension for pdf file
newName = "";
for ( var i = 0 ; docName[i] != "." ; i++ )
        newName = newName + docName[i];
newName = newName;
saveInFile = new File(sourceDoc.path + '/' + newName );
    return saveInFile;
function exportJPEG()
    var exportOptions = new ExportOptionsJPEG();
    exportOptions.artBoardClipping = true;
    exportOptions.antiAliasing = false;
    exportOptions.qualitySetting = 100;
    exportOptions.horizontalScale = myZoom;
    exportOptions.verticalScale   = myZoom;
//    exportOptions.transparency = false;
//exportOptions.saveAsHTML = true;
    return exportOptions;

Does this help?
I do applescript and javascript is another language but I found this by searching google:
var img = document.getElementById('imageId');
var width = img.clientWidth;
var height = img.clientHeight;
From:
Determining image file size + dimensions via Javascript? - Stack Overflow

Similar Messages

  • Best practice for exporting from iMovie '08 to iDVD

    I am looking to find out what is the best practice for exporting from iMovie '08 to iDVD. I have read the other postings that give the basic howto (export to Media Browser then select the video in iDVD). However, my question is a little more technical. I have 1080i HD projects. I am interested in burning them to DVD in the best possible quality. What setting should I be using when I publish to Media Browser?
    I am wondering about quality loss due to more than one conversion/compression. I suspect that when I export to the Media Browser then this is occurring. If I am not mistaken iMovie is using something like H.264 for this. Then, when I run iDVD I suspect it will it do another conversion/compression, I think to get to MPEG2. Not only could this result in a loss of quality but also it will take extra time. I am interested to know what others think about this.
    Finally, I am looking to create DVDs for a lot of video. I am wondering if there are any USB or firewire hardware devices out there that could speed up the compression. I use the Elgato Turbo.264 when I want to encode to H.264 but I wonder if there is something similar for DVD creation.
    Thanks in advance.

    the standards for videoDVD are 720x480, and usually mpeg2 encoded..
    so, your HiDef project HAS to be 'downsampled' somehow..
    I would Export with Qucktime/apple intermediate => which is the 'format' your project is allready, and you avoid any useless 'inbetween encoding'..
    iDVD will 'swallow' this huge export file - don't mind: iDVD cares for length, not size.
    iDVD will then convert into DVD-standards..
    you can 'raise' quality, by using projects <60min - this sets iDVD automatically to highest technical possible bitrate
    hint: judge pic quality on a DVDplayer + TV.. not on your computer (DVDs are meant for TVdelivery)

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Script for export in datapump  -- help needed !!!

    hello all,
    i am using the following script as batch file in my database for export
    script:
    =========
    exp name/password file=d:\exp\%date%.dmp full=y log=d:\exp\exp.log an this will replace the first file(monday) on next monday.
    similar way i need a script for data pump for full database export using datapump
    thanks ,
    gold

    login to database as a dba and create directory for your dumpfile path.
    create directory dpump_dir as 'd:\exp';
    and then use the below script for export.
    expdp username/password full=y directory=dpump_dir dumpfile=%date%.dmp logfile=exp.log

  • Scripts for Exporting Master/Work Rep

    Hi,
    I want to automate the export process and in turn was looking for any scripts for exporting the whole ODI Work/Master Rep. I checked the CLASS objects and we donot have any CLASS names for Repository exports.
    Thanks in advance for any answers..!

    Created for 10g [ http://odiexperts.com/automize-the-backup-using-odi-exports]
    but should work for 11g too :)

  • How to get rid of the banner in the middle that tells me the email is from/to, etc, I don't need that to take up space

    I don't need to know who the email is from - again. It tells me that in the list of messages. I certainly don't need to be told that it came to me. In fact, none of that information is relevant. If I tag it I can tell by the colour where/what it is. All that info is reduntant, I can put the controls in the control bar but with that wide band in the middle, I lose the screen space for either list of messages or the actual message. Before the last edition I could get rid of it but not now to my knowledge.
    BTW, the uploading of screenshot doesn't seem to work. The .jpg is 111kb, which doesn't seem to be big but maybe it is.

    If you are talking about the header bar of the Message Pane the only way to get rid of it completely is to close the message pane by pressing F8.
    There is a add on called Compact Header that will let you make it smaller.
    https://addons.mozilla.org/en-US/thunderbird/addon/compactheader/?src=ss
    I do not think this forum lets you post an image on the original post. I have not tried it but lots of people have trouble doing it.

  • How do i recover a purchase I made for more iCloud storage that i don't need?, How do i recover a purchase I made for more iCloud storage that i don't need?

    How do i recover a purchase I made for more iCloud storage that i don't need?

    Please see this website: http://support.apple.com/kb/HT4874

  • I had purchased an audio book from itunes on my iPad and when I synced my iPad with my computer, my audiobook disappeared. I have already purchased this audiobook, so now I just need to know how to get it back because it is not on iPad anymore.

    I had purchased an audio book from itunes on my iPad and when I synced my iPad with my computer, my audiobook disappeared. I have already purchased this audiobook, so now I just need to know how to get it back because it is not on iPad anymore. I don't think the audiobook was backed up to icloud but I have the receipt to prove I purchased it. Is there anyway I can get it back?

    "If I purchase an audio book in iTunes on my iPad why can't I listen to it on my Mac? "
    You can.  Why do you think you cannot?
    If you purchased it on your ipad, then you would have to transfer it to your computer. File>Devices>Transfer Purchases.
    You can then listen to it on your computer.

  • I am thinking to buy an Iphone 4s from USA. So I just want to know if I buy an unlocked phone will I able to use it in India with vodafone network. Can u also suggest where to buy the unlocked iphone 4s in USA.

    I am thinking to buy an Iphone 4s from USA. So I just want to know if I buy an unlocked phone will I able to use it in India with vodafone network. Can u also suggest where to buy the unlocked iphone 4s in USA.

    Thanks for ur reply. I will make sure that I buy 4s from nearest istore in USA where unlocked phones are also available. And yes I know about the warranty which is applicable only in USA. Ur reply has been very helpful for me thanku

  • Information about my hyperlinks disappeared from my hyperlinks panel and I need to know how to restore it.

    I am using InDesign CS6 for Windows. Information about my hyperlinks disappeared from my hyperlinks panel and I need to know how to restore it. I clicked on the panel and the hyperlinks section disappeared. I can see cross-references, but not hyperlinks.

    1.  Re: Information about my hyperlinks disappeared from my hyperlinks panel and I need to know how to restore it.
    Thank you. I can see the word, and I tried dragging but there is no moving the divider.

  • HT5616 I just NEED to know (yes or no) if I buy an  "I-app" or "I-anything" (from the I-store) like the"I-cloud" will  I be able to access (it?) on my windows 7 computer? PLEASE and THANKYOU

        I just NEED to know (yes or no) if I buy an  "i-app" or "i-anything" (from the i-store) like the"i-cloud" will  I be able to access (i-it?) on my windows 7 64- bit computer? PLEASE and THANK YOU.............. z/;8?p ......... clueless and brand-new to the "i-world" ................tonniesb
      While I'm admitting my ignorance of the "i-world",  THE SAME QUESTION ABOVE  but on my windows 7-starter mini-computer? Thanks again .....t
    You smart young guys AND girls are not going to believe this next question! ! ! ! ! !
    I have never owned a smart-phone. O.K.?? So having the computer systems I mentioned above, what SMART-PHONE should I really get? I do want your opinion's for the very best route to go.... ty agian ...t     

    No. Apps from the iTunes Store only run on iDevices like iPhones or iPads. Applications from the Mac App Store only run on Macs.

  • If I restore my phone from an old backup, will I need to know the old passcode?

    If I restore my phone from an old backup, will I need to know the old passcode?

    Yes you can delete this backup, & no, it won't delete anything off your phone.

  • Need script for exporting images to EPS

    I need to write a script to export a whole bunch of files from Indesign CS3 to EPS files. Right now we do them one at a time...here are the steps we take that we would need included in the script...
    Select all (Control A), ungroup, convert to outlines (control-shift O), export (need to be able to say black or white or RGB) and then close the file without saving.
    and if there was anyway to loop this script for 20 files at a time that would be really helpful.
    Can any help or direct me to a website that can help.
    Thanks!
    Marissa

    Maybe this one: http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    Peter

  • Script for exporting the Delegated List from Exchange 2007

    We are Planing to Migrate the Exchange 2007 Mailbox to O365 by Hybrid deployment.
    So i would like to generate the List of delegated access rights on Mailboxes, could you help the script for genetating the delegated list.

    Hello,
    Look into get-Help Get-MailboxPermission
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Script for export all text in single rtf file?

    Hi!
    I need to export all storys from indd document to a single rtf file. Is there avaible some free script for CS4 which can do that?

    if(app.documents.length != 0){
         if(app.documents.item(0).stories.length != 0){
              myGetFileName(app.documents.item(0).name);
    //========================= FUNCTIONS ===========================
    function myGetFileName(myDocumentName){
         var myFilePath = File.saveDialog("Save Exported File As:");
         if(myFilePath != null){
              myDisplayDialog(myDocumentName, myFilePath);
    function myDisplayDialog(myDocumentName, myFilePath){
         //Need to get export format, story separator.
         var myExportFormats = ["Text Only", "Tagged Text", "RTF"];
         var myDialog = app.dialogs.add({name:"ExportAllStories"});
         with(myDialog.dialogColumns.add()){
              with(dialogRows.add()){
                   with(dialogColumns.add()){
                        var myExportFormatDropdown = dropdowns.add({stringList:myExportFormats, selectedIndex:0});
              with(dialogRows.add()){
                   var myAddSeparatorCheckbox = checkboxControls.add({staticLabel:"Add separator line", checkedState:true});
         var myResult = myDialog.show();
         if(myResult == true){
              var myExportFormat = myExportFormats[myExportFormatDropdown.selectedIndex];
              var myAddSeparator = myAddSeparatorCheckbox.checkedState;
              myDialog.destroy();
              myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator);
         else{
              myDialog.destroy();
    function myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator){
         var myPage, myStory;
         var myExportedStories = [];
         var myTempFolder = Folder.temp;
         var myTempFile = File(myTempFolder + "/tempTextFile.txt");
         var myNewDocument = app.documents.add();
         var myDocument = app.documents.item(myDocumentName);
         var myTextFrame = myNewDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myNewDocument, myNewDocument.pages.item(0))});
         var myNewStory = myTextFrame.parentStory;
         for (var i = 0; i < myDocument.pages.length; i++) {
              myPage = myDocument.pages.item(i);
              for (var t = 0; t < myPage.textFrames.length; t++){
                   myStory = myPage.textFrames[t].parentStory;
                   if (!IsInArray(myStory.id, myExportedStories)) {
                        //Export the story as tagged text.
                        myStory.exportFile(ExportFormat.taggedText, myTempFile);
                        myExportedStories.push(myStory.id);
                        //Import (place) the file at the end of the temporary story.
                        myNewStory.insertionPoints.item(-1).place(myTempFile);
                        //If the imported text did not end with a return, enter a return
                        //to keep the stories from running together.
                        if(i != myDocument.stories.length -1){
                             if(myNewStory.characters.item(-1).contents != "\r"){
                                  myNewStory.insertionPoints.item(-1).contents = "\r";
                             if(myAddSeparator == true){
                                  myNewStory.insertionPoints.item(-1).contents = "----------------------------------------\r";
                   } // if not exported
              } // for text frames
         } // for pages
         switch(myExportFormat){
              case "Text Only":
                   myFormat = ExportFormat.textType;
                   myExtension = ".txt"
                   break;
              case "RTF":
                   myFormat = ExportFormat.RTF;
                   myExtension = ".rtf"
                   break;
              case "Tagged Text":
                   myFormat = ExportFormat.taggedText;
                   myExtension = ".txt"
                   break;
         myNewStory.exportFile(myFormat, File(myFilePath));
         myNewDocument.close(SaveOptions.no);
         myTempFile.remove();
    function myGetBounds(myDocument, myPage){
         var myPageWidth = myDocument.documentPreferences.pageWidth;
         var myPageHeight = myDocument.documentPreferences.pageHeight
         if(myPage.side == PageSideOptions.leftHand){
              var myX2 = myPage.marginPreferences.left;
              var myX1 = myPage.marginPreferences.right;
         else{
              var myX1 = myPage.marginPreferences.left;
              var myX2 = myPage.marginPreferences.right;
         var myY1 = myPage.marginPreferences.top;
         var myX2 = myPageWidth - myX2;
         var myY2 = myPageHeight - myPage.marginPreferences.bottom;
         return [myY1, myX1, myY2, myX2];
    function IsInArray(myString, myArray) {
         for (x in myArray) {
              if (myString == myArray[x]) {
                   return true;
         return false;
    This is a revised version of the script --  not totally tested.
    Kasyan

Maybe you are looking for

  • How can a JVM terminate with an exit code of 141 and no other diagnostics?

    Hello, We are encountering a JVM process that dies with little explanation other than an exit code of 141. No hotspot error file (hs_err_*) or crash dump.  To date, the process runs anywhere from 30 minutes to 8 days before the problem occurs. The la

  • Change display to avl grid in standard program

    Hi, My requirment is to modify the standard report for Creditors outstanding (monthly ageing - S_ALR_87012085), the output of this report is in hierarchical ALV, but I want to display it in Grid format. In the standard program there is call to subrou

  • PE51 month in text format

    hi,     I am designing a payslip in that title should show month in text like 'pay slip for -march 2007'. How it can be done. I am designing layout in PE51. Regards, Karthik.k

  • Change of Profit Center

    Dear All My Client want to change the assignment of some profit centres (for which transactions have been posted) to Cost Centres. The system is not allowing to change the profit centres as data is already available in the profit center.Request to he

  • Still no retina support?

    My Adobe Reader is latest (11.0.02), still no retina support. When it will be supported?