Can't get this droplet to save a JPEG...

I'm getting an error that it can't find the document after it's opened. The actions seem to run just fine, but it stops short of actually saving the file into the newly created folder. It also doesn't close the last document.
Can anyone find a problem with my script? I seem to have hit a brick wall here.
(I'm running Photoshop CS6.)
on open mgItems
     set myDate to (get current date)
     set y to year of myDate as text
     set m to month of myDate as integer
     set d to day of myDate as integer
     if d < 10 then
          set d to "0" & d as text
     else
          set d to d as text
     end if
     if m < 10 then
          set m to "0" & m as text
     else
          set m to m as text
     end if
set y to text -2 thru -1 of y
set myReleaseDate to y & m & d & "_iPadResized"
repeat with mgThisItem in mgItems
     tell application "System Events"
          set targetFolderPath to path of container of disk item (mgThisItem as text)
     end tell
     tell application "Adobe Photoshop CS6"
          activate
          try
               open mgThisItem
          set mgDocName to name of current document
          set text item delimiters of AppleScript to ".tif"
          set mgShortName to text item 1 of mgDocName
          set mgPackageFilePath to targetFolderPath & myReleaseDate
          my createFolders(POSIX path of file (mgPackageFilePath))
          set display dialogs to never
          set thisdoc to current document
          set docHeight to height of thisdoc
          set docWidth to width of thisdoc
          tell thisdoc
               flatten document
               if docHeight / docWidth > 0.75 then
                    do action "iPad_tall" from "iPad Resize"
               else
                    do action "iPad_wide" from "iPad Resize"
               end if
               save in file mgPackageFilePath as JPEG with options {quality:12}
          end tell
          close the current document saving no
       on error e
            display dialog e
       end try
  end tell
end repeat
display dialog "Files resized for iPad"
end open
on createFolders(pathString)
     do shell script "mkdir -p " & quoted form of pathString
end createFolders

You can save applescript files as a droplet that acts as a standalone application. This means that I select a list of files and drag them onto the droplet, activating the script.
So yes, it's a droplet, and it's also Applescript.
The code is fairly straightforward, which is why I'm confused!

Similar Messages

  • I have adobe CS 5.1 and recently (after an update) it is giving me an error (Could not save...because of a program error) every time I try to save my work as a PDF   Help how can I get this resolved??

    I have adobe CS 5.1 and recently (after an update) it is giving me an error (Could not save...because of a program error) every time I try to save my work as a PDF>  Help how can I get this resolved??

    Run the cleaner, reinstall.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    And don't bother with running any updates unless you really need them or they fix a critical issue relevant to your workflow.
    Mylenium

  • My "Hanging with Friends" app keeps crashing whenever I try to open it. I have deleted and re-downloaded the app, restarted my iPhone, and even restored my iPhone all together, and nothing is working. How can I get this app to work again?

    My "Hanging with Friends" app keeps crashing whenever I try to open it. I have deleted and re-downloaded the app, restarted my iPhone, and even restored my iPhone all together, and nothing is working. How can I get this app to work again?

    Can you start Firefox in [[Safe mode]] ?
    You can also do a clean reinstall and download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You can initially skip the step to create a new profile, that may not necessary for this issue.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • OSX sometimes places 31 character limit on file names. How can I get this error to stop?

    This error notice doesn't make sense, since many of my file names exceed 31 char. This error message pops up when saving documents, esp. web pages. As a consequence, OSX will refuse to let me save the file, until I shorten the name and so remove informative identifying features of the file name. But most of the time, OSX is perfectly happy to save files with names longer than 31 char. How can I get this error notice and block to turn off?

    I have also seen this issue it occurs regularly when transferring word documents files from my Macbook Pro running OSX 10.5.8 to my iMac running 10.9.4.
    My iMac HD should be formatted to factory standards as well since I have not mucked around with it since I bought it.

  • How can I get mail not to save sent mail on iphone?

    I use yahoo mail for my mail acct. In yahoo mail I have the sent mail folder turned off. I do not want to save my sent messages. This used to work on my Itouch but now with my new Iphone it is saving the sent messages. How can I get this to stop? I have been through all the settings and can't figure it out. You may email me at [email protected] Thanks for your help!

    Not sure how this used to work on your iPod Touch since there is no setting for an email account preferences to not save sent messages. With an IMAP account, there is an option to store sent messages on the server, or locally on the iPhone. There is no do not save sent messages setting, and the same for the email account preferences with a POP account.

  • Adobe CR 6.7 does not install into CS5, how can I get this installed to view CR files?

    Just installed CS5 onto new computer. Adobe bridge and CS5 do not recognize CR format. How can I get this installed. I have tried up dating and downloading the CR6.7 update, but can not get it to install. What do I do?

    Product updates

  • Hello, I want to restore a backup on my Iphone 4S, but in i-tunes it's not vissable. When I'll look on te pc: (username)\Application Data\Apple Computer\MobileSync\Backup\ it's there! How can I get this backup to my iphone or itunes? Thanks in advance!

    Hello, I want to restore a backup from this afternoobut in i-tunes it is not visseble. When I'll look on te pc: (username)\Application Data\Apple Computer\MobileSync\Backup\ it's there! How can I get this backup to my iphone or itunes? Thanks in advance!

    Follow the steps in this article to restore from iTunes back up:
    http://support.apple.com/kb/HT1766
    Since you say you cant see the back up in iTunes you should be able to see it when following the last step where it says for iTunes 10.7 or earlier. Dont worry as this step also works for iTunes 11.

  • TS1702 My cars 2 app mate app is not working after upgrading from ipad to ipad 2...... synced.... uninstalled and re installed several times as well as wiped ne ipad out and re did the whole proccess several times. how can I get this app working?

    I have installed the cars 2 app mate on a ipad 2 from an ipad 1 synced with itunes account.. all is working except this app. After many times of un installing and re installing aswell as talking to apple tech suport this app is still not working.... its there it just has no function...... how can i get this installed and working, my grandson is autistic and uses this app many hours a day........ it is important for me to get this up and running again for him.......

    (1) So, I found a youtube video showing how to open up my iMac and replace a Disk drive. I opened it. I removed the disk drive. I opened the metal cover of the lid of the disk drive. It was clean and immaculate; so, it destroyed and debunked the dirty drive theory. But, just to make sure I sucked around the optical sensor with a vacuum and gently brushed it with a Q-tip.
    (2) I then watched a you tube video showing how the drive operated (it was a drive supplied with power outside an iMac with a transparent cover unlike the opaque metal cover that we have on our drives). My scientific curiosity started to wonder if somehow the mechanical part (of the electro-mechanical assembly) was locked or jammed. So, I started messing with the arms with the utmost care after watching the video to see if i could move them manually. Yes on some. The main arm that is linked with the drive motor was immovable. The rest I played with a little bit, took great notice in the start of the video to see how the arms looked before inserting a disk. I then put it all back together.
    It works now. My guess is that taking it out and then placing it back in along with the resetting options that others have done was the trick. I believe it is a possibility that the hard drive became locked mechanically in some strange manner after ejecting a DVD in conjunction with the uploading of the new OS. I believe the actual removal, reinstallation, and resetting of the drive put everything back into sync. My computer sits in a climate controlled dust free environment. I knew for a fact that this hard drive was OKAY.

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • HT4798 i created my apple id account, verified but know i m unable to log on, it says incorrect password, i tried to reset via forgot password option but it does not send reset password page to my e- mail address, how can i get this sorted or delete my pr

    User created apple id account, verified but know she is unable to log on, it says incorrect password, she tried to reset via forgot password option but it does not send reset password page to here e- mail address, how can i get this sorted? or how can i get her whole apple account deleted and created new one using same e - mail address?

    The idea to jumpstart by change was not the smartest one, but gives you an opportunity to use that "temporary" account as permanent. You do not have a choice cause obviously despite you thinking that old account is no more -it does exist on Apple servers. And if you are unwilling to share your [email protected] with friend, just create one extra [email protected] for your friend. One suggestion - do not use gmail.

  • When I am home, calls to my iPhone 5 also go to my other family members' iPhones.  How can I get this to stop happening?

    When I am home, calls to my iPhone 5 also go to my other family members' iPhones.  How  can I get this to stop happening?

    Or better yet, create and use new Apple IDs for others in your household. You could always use different Apple IDs for iCloud services (like iMessage and FaceTime) and iTunes and App Store., but it's even easier to share purchased content now with Family Sharing.

  • I bought 3 iPhone 4s and each should have 5gb of cloud. I want to only use my one iTunes ID. How can I get this storage space increased to the 15 GB?

    I bought 3 iPhone 4s and each should have 5gb of cloud. I want to only use my one iTunes ID. How can I get this storage space increased to the 15 GB?

    iCloud storage is not allocated by device. iCloud storage is allocated to your iCloud AppleID. You get 5GB of iCloud storage.

  • Somehow my iTunes app has been put into the trash.  How can I get this and all of the stuff that was in it back to my Application folder?  I try to drag it out of trash, but it won't work.

    Somehow my iTunes app has been put into the trash.  How can I get this and all of the stuff that was in it back to my Application folder?  I try to drag it out of trash, but it won't work.

    Also, when I do try to drag it out of the Trash to put it back into Applications (on the Finder sidebar), it asks me to authenticate with the administration password.  I enter it, and then a window appears saying that I can't do that because I do not have permission to modify iTunes.  Please help.

  • My ipod nano was synced by itunes and removed all of my music and game files. I am in the process of adding my music back one cd at a time, but there is no history of tetris that I paid for from the itunes store. How can I get this game back for my ipod?

    My ipod nano was synced by itunes and removed all of my music and game files, and replaced my music with my kids music that they have put into the current itunes library. My music is nowhere to be found on my computer, so now  I am in the long, forever process of adding my music back one cd at a time, but there is no history of tetris that I paid for from the itunes store. How can I get this game back for my ipod?

    Contact iTunes support and explain your situation to them.  They may let you redownload it at no cost.
    http://www.apple.com/support/itunes/contact.html
    If they don't, I'm afraid you'll have to purchase it again.  Sorry.
    B-rock

Maybe you are looking for

  • Can I use Swing controls with Forms 9i?

    Is there a way to use Java Swing controls with Forms 9i via a PJC or something? If so, is there a white paper on it? Thanks.

  • Rate of exchange fixed in PO

    Hi, When i've created a purchase order i fix (inconsciously) the exchange rate and currency. so the purchase order currency and the exchange rate cannot be changed during posting an invoice in MIRO. Please i want to post an invoice in MIRO with a dif

  • Streaming is EXTREMELY slow yet YouTube works fine.

    I have a 160gb AppleTV that is sync'ed with a PC and streams from my iMac. My iTunes library on the iMac is 400gb+ stored on a USB external drive. When I originally configured streaming from my shiny new iMac you could browse the content with no issu

  • DISCOVERER 3.1, IF,THEN STATEMENT

    Dear All, I am not an experienced Discoverer user. Please forgive my ignorance. I would like to create a column that will "fill in" certain text based on the contents of other columns. I have been partially successful by using the DECODE function, bu

  • Adobe PDF - Filling a table

    I am trying to determine why I can't get a table to fill on a PDF.  I have my own PDFs and a table on each.  No matter what I do I can't get the table to be populated.  I try through my program and I tried through the form test tool.  Then I assumed