AppleScript to resize images and save with new name

I want to make an apple script, which resizes all images of a folder regardless what kind of filetype.
The source folder will change every day.
With the script i want to choose a source Folder, resize all images and save the files with my jpeg options in the same folder, but with adding  „_ipad“ in the filename.
I tried to edit an existing script from this forum, but in Photoshop 5.1 i get the error-message "This function is possibly not available in this Version" in line 18 "save in file newFileName as JPEG with options myOptions"
How can i save the documents with new name in the existing folder?
Thanks.
This is the script i’m working with:
set inputFolder to choose folder with prompt "Wähle einen Ordner:"
--set destinationFolder to choose folder with prompt "Wähle einen Zielordner" as string
tell application "Finder"
          set filesList to (files of entire contents of inputFolder) as alias list
end tell
tell application "Adobe Photoshop CS5.1"
          set UserPrefs to properties of settings
          set ruler units of settings to pixel units
          repeat with aFile in filesList
  open aFile showing dialogs never
                    set docRef to the current document
                    tell docRef
                              set newFileName to my getBaseName(name)
  --resize image height 240 resolution 72 resample method bicubic sharper
  change mode to RGB
  resize image resolution 72
                              set myOptions to {class:JPEG save options, embed color profile:true, quality:12, format options:progressive, scans:3}
  save in file newFileName as JPEG with options myOptions
                    end tell
  close the current document saving no
          end repeat
          set ruler units of settings to ruler units of UserPrefs
end tell
on getBaseName(fName)
          set baseName to fName
          repeat with idx from 1 to (length of fName)
                    if (item idx of fName = ".") then
                              set baseName to (items 1 thru (idx - 1) of fName) as string
                              exit repeat
                    end if
          end repeat
          return baseName
end getBaseName

This seems like a Photoshop error not an AppleScript one. Have you looked in the Photoshop dictionary to see if the command you are getting the error on exists and if it has those options?
If all you want to do is resize image files and save the resized image file you might want to look at Automator. Specifically the Scale Image action under Photos.
regards

Similar Messages

  • Applescript Help:  Backup iCal and save to New Folder on Desktop

    Hello,
    I have a script one third done. I'm a noobe to Applescript and coding. Hopefully, someone here can help me.
    I'm wanting to first backup my iCal data and have it saved to a newly created folder named "xxx" to the Desktop.
    1. Create folder on desktop named "xxx"
    2. Open iCal and backup iCal data
    3. iCal saves to the "xxx" folder
    So far I have:
    tell application "iCal" to activate
    delay 2
    tell application "System Events"
    tell menu item "Back up iCal…" of menu "File" of menu bar 1 of application process "iCal" to click
    delay 1
    keystroke "iCal Backup"
    keystroke "d" using command down
    delay 1
    keystroke return
    tell application "iCal" to quit
    end tell
    The above just opens iCal, saves the file to desktop and quits. I want it to save to a folder then quit. Is this possible? Ultimately, I also want to save a backup file of Firefox bookmarks and have that file save to the same "xxx" folder. Any help will be appreciated.

    Instead of using the command-d keystroke, use tabs and arrow keys to navigate the save dialog.

  • Transform implementation goes wrong when I try transforming a image through script and save the new image using a HTML to canvas plugin.

    Transform implementation goes wrong when I try transforming a image through script and save the new image using a HTML to canvas plugin. The rotation comes up fine, but the origin of the transformation is faulty (compared to other browsers like Chrome & IE)

    A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.

  • How to scan with capture image and save 10.6.8

    how to scan with capture image and save 10.6.8 ?

    Instructions for using Image Capture for this available via the 2nd section.
    http://support.apple.com/kb/HT2502

  • Draw graphics on Image and Save it

    hi!,
    Can anyone help me how to draw graphics(Line, rectangle.ect) on an Image and save it. I need to do the following steps.
    1. Get the Image from the local file system
    2. Based on the parameters i receive for graphics(Ex: rectangle).
    -I have to draw a rectangle on the Image.
    3. Save the Image again to the file system
    I would appreciate if any one has any ideas or sample code I can start with.
    Thanks!!!

    Here's an example using the javax.imageio package.
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    public class DrawOnImage {
        public static void main(String[] args) {
            try {
                BufferedImage buffer = ImageIO.read(new File(args[0]));
                Graphics2D g2d = buffer.createGraphics();
                Rectangle rect = new Rectangle(10, 10, 100, 100);
                g2d.setPaint(Color.RED);
                g2d.draw(rect);
                ImageIO.write(buffer, "JPG", new File(args[1]));
            } catch (IOException e) {
                e.printStackTrace();
    }

  • How do I take an object from an image and save it so I can use it in other images?

    I am trying to figure out how to take an object from an image and save it so I can re-use it again in other pictures?  I know how to use the magic wand to select the object and place it in a blank image.... but I do not know how to re size the selected object or keep it for later use.  Basically I would like to use the object the same way that I use the graphics ... so I guess I am wondering if there is a way that I can make my own graphics... I have Elements Photoshop 13.  Thanks for any help/advice....  Jerrie

    Hi Jerrie,
    You can re-size using Transformation tool. Ctrl + T will give you a box to re-size the image or object.
    You can save these object as PNG file with Transparent layer. You can use these objects later in another projects.
    Regards,
    Sandeep

  • Space between DIV with image and DIV with image background

    I have just about finalized the new design on my website. The only issue I am having now is on the gallery page.  There is a thin space between a DIV with an image and DIV with an image background.  I am using these DIV's to give the illusion of a blue border. If you look at any of the other main pages on the site the space is not there. Any ideas? 
    http://liquidfirefishing.com/index.php
    http://liquidfirefishing.com/gallery/main.php
    Here are a couple of screenshots to show exactly what I mean.

    Hello, 
    both my "IE8" and my "FF 7.01" show the blue boundary lines. Here my screenshots, left side IE8, right side FF:
    Header 1
    Header 2
    Hans-Günter

  • How to change and save a new file in Edge web Lumira server for Team ?

    Hi Lumira folks,
    I've installed SAP Lumira 1.0, Edge edition and View a sample 'Dairy Wholesaler-Sample"
    I'd like to change it and save as new file, but "Save" button is disabled and when I put my mouse over the button,
    it says "Save Option is disabled in this version".
    Is there any idae how to change and save as a new file in Lumira Edge ?
    Many Thanks.
    JH

    I've just found the reason as below.
    http://scn.sap.com/community/lumira/blog/2015/03/20/lumira-server-for-teams-edge-edition-version-compatibility
    The current version of Lumira
    server for teams is 1.0. This version uses Lumira 1.22 as its 'engine' as this
    was the version of Lumira Desktop that was shipped at the same time.
    Hence with the current Lumira
    version compatibility; namely that a newer version of the product can open an
    older document, but an older version cannot open a newer document, care must be
    taken when deploying Lumira server for teams.
    Lumira server for teams is only
    compatible with Lumira desktop 1.22. If you intend to deploy Lumira server for
    teams, ensure your desktop users do not move to a later version of the desktop.
    Content created in a later version of Lumira desktop can be uploaded and shared
    via Lumira server for teams, but it cannot be viewed or edited online in the
    browser.
    Ensure desktop users disable the
    auto update capabilities in the desktop preferences, and set the update to
    none.

  • SuperImpose two images and save it as a single image[urgent]

    Hello..
    Can anyone tell me how do we superimpose two images and save it as a single image.The image on the top is smaller in size in my case.
    Please Help..

    import java.awt.Graphics2D;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    class TwoBecomeOne {
        public static void main(String[] args) throws IOException {
            BufferedImage large = ImageIO.read(new File("images/tiger.jpg"));
            BufferedImage small = ImageIO.read(new File("images/bclynx.jpg"));
            int w = large.getWidth();
            int h = large.getHeight();
            int type = BufferedImage.TYPE_INT_RGB;
            BufferedImage image = new BufferedImage(w, h, type);
            Graphics2D g2 = image.createGraphics();
            g2.drawImage(large, 0, 0, null);
            g2.drawImage(small, 10, 10, null);
            g2.dispose();
            ImageIO.write(image, "jpg", new File("twoInOne.jpg"));
            JOptionPane.showMessageDialog(null, new ImageIcon(image), "",
                                          JOptionPane.PLAIN_MESSAGE);
    }

  • Is it ok to leave my old photos in Aperature and start with new photos in Lightroom?  MacPro with 2 x 2.26 Ghz Quad-Core Intel Xeon processor, 6 GB memory, 1 TB harddrive.

    Is it ok to leave my old photos in Aperature and start with new photos in Lightroom?  MacPro with 2 x 2.26 Ghz Quad-Core Intel Xeon processor, 6 GB memory, 1 TB harddrive?
    Or should I transfer them to Lightroom?

    That's really a personal preference. Support for Aperture is coming to an
    end and you may find yourself unable to get to theses photos in the future
    in the case of a HDD crash if you can't get the software to reinstall.
    Faced with that prospect, I would probably put it on my list of things to
    do when I am feeling really bored and looking for something to amuse myself
    with. You can export your Aperture photos in their original format to a
    folder on your desktop and then import them into Lightroom. Use the copy
    option on the import to save the photos in a new folder within your
    Lightroom catalog.

  • TextEdit: how save document with new name?

    I tryed in many ways to save modified document with new name with TextEdit but no one works for me.

    Use TextEdit > File > Duplicate.
    For this example, my original document is named Lorem.rtf. I open it with TextEdit, and then Duplicate it. A new TextEdit document window appears. Its default name is Untitled (Lorem copy). If you pass your pointer near the right parenthesis, a downward pointing triangle appears. Click that and the Name field has Lorem Copy preselected. Press the delete key to erase this name, and enter the new name — followed by a return to set it.

  • Trying to create an image and save it on file system

    Hi,
    I'm trying to create an image and save it in the file system :
         public static void main(String[] args) {
         int wid = 632;
         int hgt = 864;
         BufferedImage bufferedImage = new BufferedImage(wid,hgt,BufferedImage.TYPE_INT_RGB);
         bufferedImage.getGraphics().setColor(Color.black);
         bufferedImage.getGraphics().drawOval(30, 30, 100, 100);
              bufferedImage.getGraphics().drawString("test me one two three",2,2);
              bufferedImage.flush();
    try {
                   ImageIO.write(bufferedImage,".bmp",new File("C:/MyImage.bmp"));
         } catch (IOException e) {               
                   e.printStackTrace();
    THE PROBLEM : It creates C:/MyImage.bmp on my file system, but the file is empty (size 0).
    Am I missing something ?
    Thanks

    Try changing ".bmp" to "bmp". If that fails, try posting an SSCCE.
    Edit 1:
    And in future, please use the code tags when posting code, code snippets, HTML/XML or input/output. To do that, select the code and click the CODE button seen on the Plain Text tab of the message posting form.
    Edited by: AndrewThompson64 on Aug 3, 2009 1:23 AM

  • Favicon does not show up on Google chrome and firefox with new muse release. Opera showing favicon ok.

    Favicon does not show up on Google chrome and firefox with new muse release when exporting HTML or publishing with FTP. Opera showing favicon ok. Previews Muse release was working fine.
    this website was created with one update back BK Foto
    this one page was updated with latest updated Muse and after publishing with FTP through Muse favicon does not show up Paslaugų Era | Foto Video Paslaugos

    Export your HTML and then Just edit index.html with any text editor look for sentence <link rel="...................................>
    Then delete all this sentence and copy this one
    <link href="//PATH/favicon.ico" rel="shortcut icon" type="image/x-icon">
    PATH = Where you have your favicon.ico
    I usually copy the favicon.ico in the folder images so the sentence will be like this
    <link href="//mydomain.com/images/favicon.ico" rel="shortcut icon" type="image/x-icon">
    i hope it helps you
    Sorry about my english, my spanish is much better
    Juan Pedro Avila

  • Is there a way to create a PDF form that ANYONE can fill out and SAVE with their content?

    Is there a way to create a PDF form that ANYONE can fill out and SAVE with their content? By anyone, I mean someone who can download and use the free Adobe Reader, on either a Mac or PC. I have Acrobat Pro, and would like to be able to create forms that can not only be filled out and printed, but saved and emailed, which is not an option with the forms I have created to date. They can be filled out, but not saved, with Adobe Reader.
    TIA,
    Nancy

    To do what Dave indicated you need to do, it depends on what version of Acrobat you have:
    Acrobat 8: Advanced > Enable Usage Rights in Adobe Reader
    Acrobat 9: Advanced > Extend Features in Adobe Reader
    Acrobat 10: File > Save As > Reader Extended PDF > Enable Additional Features
    Acrobat 11: File > Save as Other > Reader Extended PDF > Enable More Tools (includes form fill-in & save)
    I wonder what it will be next time?

  • After Upgrading to 10.6.8 my aperture app starts but hangs trying to read the Lib. I removed the old lib and start with new. but still have the problem. 10.6.8 also made my Shark FX7 do the same thing. Any Ideas? Thanks

    After Upgrading to 10.6.8 my aperture app starts but hangs trying to read the Lib. I removed the old lib and start with new. but still have the problem. 10.6.8 also made my Shark FX7 do the same thing. Any Ideas? Thanks

    Verifying volume “Macintosh HD”
    Performing live verification.
    Checking Journaled HFS Plus volume.
    Checking extents overflow file.
    Checking catalog file.
    Checking multi-linked files.
    Checking catalog hierarchy.
    Checking extended attributes file.
    Checking volume bitmap.
    Checking volume information.
    The volume Macintosh HD appears to be OK.

Maybe you are looking for

  • Report to measure CRM Activities performance

    Hi experts, I'm on SAP CRM 6.0 and currently doing some research about available reports on Web UI. I'm particularly interested in reports that will allow to measure activity performance like: how long has an activity been opened? how long since the

  • Using XML Export to create dynamic Spry data sets

    I'm following this tutorial http://www.adobe.com/devnet/dreamweaver/articles/spry_xml_export_03.html And the final output is like this http://www.adobe.com/devnet/dreamweaver/articles/spry_xml_export/fig04.gif mine just looks like this http://76.163.

  • Any tips using Muse with Windows XP?

    Does anyone have any tips for using Adobe Muse with Windows XP?

  • Array of Ftree.Node type

    Hi, I'm using forms6i. I want to create an array of nodes. Like i have seen, using varray, to create array of varchar like TYPE name IS VARRAY(4) OF VARCHAR2(10); I want something like this TYPE prev_node IS VARRAY(4) OF FTREE.NODE; But when i'm usin

  • While saving data in xd02

    hi all, one subscreen is created for Customer master (XD02) & there is one field in the sub screen. To validate this field( it should not be blank), i put error message in SAPMF02D exit. if i do not put any data on this field & then press 'SAVE' butt