Save Selection to JPEG

I just upgraded from Photoshop CS2 to CS4, and I found that a script I wrote no longer works.  I attached a text version of the file to this thread.
Basically, the script allows me to open a file, make a selection, and quickly save the selection to a JPEG.  When I use ExtendScript to step through the script, it errors on the following line:
     var docNew = documents.add(width, height, lResolution, sDocName, oMode);
Can someone please download the script, try to run it, and let me know if they have the same error?  If possible, I'd like to know how to fix this problem.  This script saves me huge amounts of time, and I would really like it to work.
Thanks,
Matthew Pfluger

Paul,
Thank you!  That pointed me in the right direction.  I changed both 'width' and 'height' to unit values of type 'px' and oMode to NewDocumentMode.RGB.  That caused the script to correctly make a new document.
I also had to change the routine that calculates the selection bounds.  Before, it wasn't checking and setting Units to Pixels before calculating the selection bounds, though the return array implied this was the case.  To solve this, I added the following line:
     app.preferences.rulerUnits = Units.PIXELS
This caused the subfunction to return an array of pixels defining the selection bounds.
Paul, thanks again for your help.  I'm normally a VBA and VB.NET programmer, and it's fun to step into a new language.  When I clean up the script, I'll post the revised text.
Matthew Pfluger

Similar Messages

  • Since updating Firefox as suggested, when I 'save as' a jpeg, it automatically finds the folder and it's always the wrong folder. How can I disable this feature and go back to the original mode where it remains in the folder I choose until I change it?

    For example, I saved a jpeg named 'picasso the guitarist'. I have folders titled A to Z. When I click 'save as' it might open the 'K' folder and I have to manually search the 'P' folder for 'Picasso' and save file. The most irritating thing is, when I 'save as' another jpeg of say 'pieter mother & child' it goes to another folder and does not remain in the 'P' folder, rather it goes to the 'X' folder or some other. This didn't happen before the last upgrade. Can I disable this new 'help' feature that is taking more time than the old version?

    Current Firefox versions remember the download directory based upon the URL, so if the URL changes then the default folder may be chosen if there hasn't been selected a download folder before for that server.
    *[[/questions/889958]]
    *[[/questions/882443]]
    Bug 536503 - Last downloaded-to directory should be remembered on a site-by-site basis
    Firefox 11 will have a workaround by providing a pref (browser.download.lastDir.savePerSite) to disable this feature.

  • Adobe acrobat standard save pdf to jpeg is it possibel?

    I have a question about adobe acrobat standard.
    can you save pdf to jpeg? or is it just the Pro version that it works on?

    Try these steps to see if things are working at all. If they work, then it is a process of going one step at a time until the problem is isolated.
    1. Print a simple file to the Adobe PDF printer with print-to-file selected.
    2. Open the file created in (1) in Distiller and see if the conversion completes.
    If (2) is unsuccessful, you will get errors in the Distiller window indicating the problem. With success, the next step is to check if AcroTray is running, so simply print without using print-to-file. If it does not work, then look for AcroTray.exe in your Distiller folder. This application must be working if the print to Adobe PDF is to work correctly.

  • Save Tiff to jpeg

    Help , I am using CS2 and the tiff files that I have been working on I want to convert to jpeg format , I select "save as" but  when the box opens I do not have an option to save as a jpeg all other relevent files seem to be there but no jpeg option, any one got any ideas

    Thank you, my tiff file was a 16bit greyscale which I forgot to mention ,by changing the mode to RGB colour and then changing to 8bit as well allowed me to convert to a jpeg
    so thank you very much for the info
    regards mrwales007

  • 'Save As' to JPEG format (or to TIFF)

    The 'Save As' command produces 20 different file format options to choose from. When 'saving as' to the default PSD format, the selection is obviously quick and easy. However I mostly 'save as' to JPEG format or TIFF format and it is awkward to make the JPEG or TIFF format selections each time.
    After doing 'Save As', I have been clicking on 'Format' and then typing 'j' or 'ti' to bring up JPEG or TIFF from the menu of 20 formats to speed up the selection a little bit as compared to scrolling through the Format menu.
    But it would be much easier to have a script that could bring up a modified version of the "Save As" dialogue box so that 'Save As' to JPEG format or 'Save As' to TIFF format could be executed very efficiently and without having to wade through the clutter of the 17 other file formats in the Format menu which I hardly ever use.
    I have done a fair amount of web searching, including on ps-scripts.com, but so far without finding a good solution to this. Any help would be much appreciated.
    Of course I have thought of creating an Action (with assigned keyboard shortcut) which saves to JPEG and another Action which saves to TIFF. However, the saved file then always ends up in one location and with the same file name, therefore often requiring the additional steps of renaming and moving the file.
    Batch processing of Actions (perhaps in conjunction with the Image Processor script) is perfect for batches, especially for large batches but I was hoping for something quick and easy for saving files individually.
    Thanks!
    Geoff
    P.S. I also tried finding a way of disabling all the 'Save As' file formats which I never use so that the 'Save As' format choices would be very few (i.e. 3 or 4 instead of 20) but have had no success there.

    It's been awhile since I played with the saveAs function.
    Pretty sure you have to type the file name in the save dialog
    Here is a function I created for work.
    I removed a lot of code from it that doesn’t pertain to this topic but the code should work
    This might help you with a little more understanding and show how you can hard code where to save without even bringing up a dialog box
    saveAsPNG( filelocation + filename )// usage
    function saveAsPNG( where ){
                   var tmpFile = File(where + '.png' );
                   var pngOpts = new ExportOptionsSaveForWeb;
                        pngOpts.format = SaveDocumentType.PNG
                   //     pngOpts.PNG8 = true;
                        pngOpts.transparency = true;
                   //     pngOpts.interlaced = false;
                        pngOpts.quality = 100;
                   app.activeDocument.exportDocument(tmpFile,ExportType.SAVEFORWEB,pngOpts);
              return true;

  • CS4 won't save as a jpeg

    Hi!  I'm trying to make a 4" x 8" greeting card and I did all of the work and now it won't allow me to save as a jpeg!  I need to upload it to mpix if that helps at all.  Has anyone had any issue with this and how did you fix it?  Thanks!

    Depending on the format you started with, Jpeg is not always an option for saving.
    If you create a document from scratch, but select the wrong bit rate, or color profile you may only be able to save it as a gif or png or other format but not jpg.
    You could try opening it with Preview and then using Grab (in your utilities folder) to capture it as a jpg.
    I do this all the time with downloaded gifs that aren't able to edit or save as jpg.

  • Blurry smart objects in Photoshop Save for Web jpegs

    I create graphs, etc in Illustrator, place them as Smart Objects in a master Photoshop file before outputing Save for Web jpegs to use as PowerPoint slide backgrounds. Everything created in Illustrator or Photoshop through that process (Quality 80 or 100 with any of the SfW options on or off) Save for Webs are blurry when imported (at 100%) into PowerPoint. The only way I have been able to get anything crisp in PowerPoint was saving a Photoshop pdf. However, that was only the text created in Photoshop. The Illustrator Smart Object part was still blurry. Anyone have any idea on the best process to combine Photoshop and Illustrator files into one file for import into PowerPoint as a clean, crisp background? At this point I am open to all suggestions.

    There are parts that are being added in Photoshop, hence going from Illustrator through Photoshop as a Smart Object and then onto PowerPoint. If I wasn't 5 months down the line and just nearing deadline, I would recreate everything in Illustrator. Assuming that I have to continue at this point down the Illustrator through Photoshop line of working, how do you designate pngs or jpegs to be 220ppi. Jpegs have a 1-12 quality (and 12 is still blurry).
    Note regarding PowerPoint, I embed the full-page image into the background so others that are using this can't move (by accident or on purpose) the background.

  • Cant save as a .jpeg from a .pdf in acrobat X

    Simple as the title reads. I go to save as a jpeg and save it into a file and it never appears. Don't ever receive and error code or anything.
    Thanks

    Hey burn5860,
    Are you using the update version of Acrobat X?
    Have you tried saving any other PDF file to JPG?
    You might need to try 'Repair Acrobat Installation' from the Help menu.
    Regards,
    Anubha

  • Just upgraded to Mavericks. Now I cannot access scans from my hp scanner. After it complete the scans and I try to save as tiff, jpeg or pdf I get a either a grey blur or a message that says cannot save because the file cannot be written to.

    Just upgraded to Mavericks. Now I cannot access scans from my hp scanner. After it complete the scans and I try to save as tiff, jpeg or pdf I get a either a grey blur or a message that says cannot save because the file cannot be written to. I did not have any problems before the upgrade. I would greatly appreciate any light shed on this.

    Go to the HP site and look for drivers for your scanner. It apparently needs an updated driver to work with Mavericks.

  • I made a picture collage in pages from the pictures in iPhoto.  You used to be able to print and then say save as a jpeg to iPhoto and that option is gone.  How do you turn your document into a jpeg now.

    I made a picture collage in pages from the pictures in iPhoto.  You used to be able to print and then say save as a jpeg to iPhoto and that option is gone.  How do you turn your document into a jpeg now?

    If you chose print, you can save as PDF. If you open the saved PDF in preview, you can save as JPEG, GIF, PNG. FYI you can crop in preview.
    Another option is you could use command + shift + 4 to do a screen shot of a specific part of of the screen.

  • Is there way to export a selection to JPEG through script (CS3)

    Hi all,
    Is there way to export a selection to JPEG through script (CS3).
    CS2 has possible method to export a selection to JPEG using the method
    Application.JPEGExportPreferences.ExportingSelection = True. But this method is not supported in CS3.
    Regards,
    Hemi

    Hi Hem,
    http://forums.adobe.com/thread/424774?tstart=30
    regards,
    sudar

  • Acrobat save pdf as jpeg wrong colours

    acrobat 5,  win xp
    open a pdf
    save as a jpeg
    the colours are mad, skin becomes blue and so on.  (I am not viewing this in 3D <g>)
    there are some option settings but i dont think they make the difference)
         compression (whatever, medium for instance)
         format (baseline optimised say)
         colorspace (either of Determine Automatically or Color, makes no difference)
         resolution (automatic)
    Does anyone know the secret?
    Thanks
    Steve

    Today I cannot reproduce the problem; I'm really confused, this has happened for ages, I don't think it ever worked properly till today-maybe there has been a sneaky update  (menu-Help-Check for Updates)
    this is using the same original document on the same pc.  Oh except I just trimmed the original down from 32pp to 1 page (I was trying to create an example to upload).  Nope thats not it.  Maybe I was using a lot or resources at the time.  I'm flummoxed.  try rebooting?
    anyway
    save as jpeg
    Quality High
    Baseline standard
    Colorspace - determine automatically
    resolution ditto
    Steve

  • HDR Save as a JPEG

    Hello,
    I've been using the merge to HDR option in Camera Raw and tone mapping in Raw. Now after all of my hard work getting the image just right the only way Photoshop will allow me to save as a JPEG is by merging the layers to form an 8 Bit image. Doing this however opens up the HDR Toning dialogue box drastically changing the image, does this mean that it's impossible to save as a JPEG using the Merge to HDR function in Camera Raw, if so is there another way I can upload my image to the internet? Many thanks!

    The other way to do things is to set your Preferences / File Handling to have ACR do the 32-bit to 16/8-bit toning, and when you're exiting HDR Pro, just cancel out of the ACR dialog that comes up and then on your 32-bit layer, use Mode / 16- or 8-bit which will bring up ACR instead of the older HDR-Toning panel, and you can do the 32-bit to 8-bit conversion in ACR as a separate step.  Whether this method makes sense depends on what else you might be doing with the 32-bit layer in PS.  If nothing then using ACR to do the 32-bit to 16/8-bit conversion might make more sense.

  • How to save tiff as jpeg?

    Hi,
    I am trying to save a tiff image as a jpeg.
    I opened the tiff file in camera raw and made some adjustments, then opened it in Photoshop. There are no layers. Is there a way to save this as jpeg?
    Thank you

    Make sure you convert it to RGB or Grayscale, and 8 bit/channel (the modes that JPEG supports).

  • Save selection criteria in payment wizard

    Hello,
    Does anyone know what the option 'Save selection criteria only' at the end of the payment wizard actually means?  Does it mean it will save the criteria you choose e.g selecting a specific property and BP group or does it mean it will save the results returned from your selection criteria the previous time you ran it?
    Many thanks,
    Kate

    Hi Gordon,
    I thought the same however when I tested this it did not seem to work in this way.  I selected property 6 which returned one business partner which was correct and when I got to the last step of the payment wizard i chose 'Save selection criteria only'.  I then went into the BP master data record of a different supplier and ticked property 6.  When I went back into the payment wizard and went through the one I had just saved, the second business partner was not displayed.  If i then start a new payment run and choose property 6 in the selection criteria, both suppliers were shown.  It seems to only be saving the results that it returns from the selection criteria rather than the selection criteria itself.
    Kind regards,
    Kate

Maybe you are looking for