IPhoto file creation date inconsistencies during drag and drop

I have noticed that if I drag and drop a photo from iPhoto to Finder, the file creation dates in Finder are inconsistent.
(This question is related to drag and drop only and not File->Export, which always uses the export date and timestamp for the file creation date and thus does not suit my needs).
TEST A -- If the EXIF DateTimeOriginated is 01/01/2013, and today's date is 03/03/2013, then:
In some cases when I drag a file to Finder, the EXIF date is used as the file modification/creation date in Finder
In some cases, today's date is used as the file modification/creation date in Finder
In some cases, a date in between the EXIF date and today's date is used
It appears that for case A1, these are files that do not have a modified copy.  That is, if you select the photo in iPhoto and then click "File" -> "Reveal In Finder", the "Modified File" choice will be greyed out.
For cases A2 & A3, iPhoto has inexplicably decided to create modified versions of these files either today or sometime in the past.
TEST B -- I have read that unexplained modifications are tied to the auto-rotate function in cameras, and it does seem to be the case when I performed the test below:
Select a large group of landscape format photos (these would not have been auto-rotated), then drag and drop to Finder.  The file creation dates are set to the EXIF date
Add some portrait photos to the group in (1).  Now the file creation date of ALL photos including the non auto-rotated photos are set to the current date
The behaviour in B2 is clearly wrong, since the landscape photos should be the same as in B1.  This is bug #1.
Furthermore, iPhoto appears to be inconsistent with when these modifications are made.  For example, I dragged & dropped an auto-rotated photo on 02/02/2013, then dragged & dropped it again today, then the file creation date in Finder (and also the date of the modified file in iPhoto, as shown in iPhoto File->Reveal In Finder->Modified File) can either the EXIF date (01/01/2013), the late of the last drag & drop (02/02/2013), or today's date (03/03/2013); there does not appear to be any rhyme or reason to this.  This is bug #2.
In any case, saying "you should never use drag & drop in iPhoto" (as I have read in some other forum posts) isn't a solution, because Apple should either (a) support this function correctly or (b) remove it altogether.  Furthermore, I regularly burn photos to disk for others so having the file date and timestamps correctly set to the EXIF date helps keeping the photos sorted in the directory listings for multiple OS, so File->Export isn't a solution.

File data is file data. Exif is photo data. A file is not a photo.  It's a container for a photo.
When you export you're not exporting a file. You're exporting a Photo. The medium of export is a new file. That file is created at the time of export, so that's its creation date. The Photo within that file is dated by the Exif.
There are apps that will modify the file date to match the Exif.
The variation you're seeing is likely due to the changes in how the iPhoto library works over the past few versions. Drag and drop is handy, but is not a substitute for exporting, nor intended to be.

Similar Messages

  • Compare time slot in dates while making drag and drop..

    Hi,
    The drag and drop is working fine without conditions, but I have to check the time slots between two dates. If the time of both date are same it should not dropped else it can drag and drop. I use the code below, but not getting executed according to condition.. Please provide suggestion and ideas to get it executed..
    declare
    l_date_value varchar2(150) := apex_application.g_x01;
    l_primary_key_value varchar2(150) := apex_application.g_x02;
    l_full_time varchar2(150);
    l_time_a varchar2(150);
    l_time_b varchar2(150);
    begin
    select
    ltrim(replace(to_char(resv_start_date,'hhmiAM'),'00',' '),'0')||','|| ltrim(replace(to_char(l_date_value ,'hhmiAM'),'00',' '),'0')
    into l_full_time
    from reservation
    where resv_no=l_primary_key_value;
    select SUBSTR(l_full_time, 1 ,INSTR(l_full_time, ',', 1, 1)-1) into l_time_a from dual;
    select SUBSTR(l_full_time, INSTR(l_full_time,',', 1, 1)+1)into l_time_b from dual;
    begin
    if l_time_a<> l_time_b then
    update reservation set RESV_START_DATE = to_date(l_date_value,'RRRRMMDDHH24MISS') where Resv_no= l_primary_key_value;
    end if;
    exception when others then
    Raise_application_error(-20001,'Error'||SQLERRM);
    end;
    end;
    Thanks..

    First 3 .as are the component
    source. in the last test.mxml file i have written the drag and drop functionality.
    can any help me?? please

  • How to outline selected cells during drag and drop in the jtable

    Hi,
    I have spent a lot of time to find out how to outline selected cells during drag in the jtable, but I did not find the answer.
    Can anybody give me a tip, where to read more about this problem or even better, give an example...
    I have the following situation:
    1.Table has 10 rows and 10 columns
    2.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION) and setCellSelectionEnabled(true)
    3.user select 5 cells in 4th row (for example cell45,cell46,cell47,cell48 and cell49)
    4.user starts dragging. During dragging an outline should be drawn. Outline should be a rectangular with width of 5 cells and height of one cell. Outline should move according to the mouse position.
    5.rectangular disappears when dropped
    Regards,
    Primoz

    In "createTransferable" you can create a drag image
    which you can paint in "dragOver" and clear in "drop" method of DropTarget :
    package dnd;
    * DragDropJTableCellContents.java
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    public class DragDropJTableCellContents extends JFrame {
        public DragDropJTableCellContents() {
            setTitle("Drag and Drop JTable");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            getContentPane().add(createTable("JTable"), BorderLayout.CENTER);
            setSize(400, 300);
            setLocationRelativeTo(null);
        private JPanel createTable(String tableId) {
            DefaultTableModel model = new DefaultTableModel();
            for (int i = 0; i < 10; i++) {
                model.addColumn("Column "+i);
            for (int i = 0; i < 10; i++) {
                String[] rowData = new String[10];
                for (int j = 0; j < 10; j++) {
                    rowData[j] = tableId + " " + i + j;
                model.addRow(rowData);
            JTable table = new JTable(model);
            table.getTableHeader().setReorderingAllowed(false);
            table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            table.setCellSelectionEnabled(true);
            JScrollPane scrollPane = new JScrollPane(table);
            table.setDragEnabled(true);
            TableTransferHandler th = new TableTransferHandler();
            table.setTransferHandler(th);
            table.setDropTarget(new TableDropTarget(th));
            table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(scrollPane);
            panel.setBorder(BorderFactory.createTitledBorder(tableId));
            return panel;
        public static void main(String[] args) {
            new DragDropJTableCellContents().setVisible(true);
        abstract class StringTransferHandler extends TransferHandler {
            public int dropAction;
            protected abstract String exportString(JComponent c);
            protected abstract void importString(JComponent c, String str);
            @Override
            protected Transferable createTransferable(JComponent c) {
                return new StringSelection(exportString(c));
            @Override
            public int getSourceActions(JComponent c) {
                return COPY;
            @Override
            public boolean importData(JComponent c, Transferable t) {
                if (canImport(c, t.getTransferDataFlavors())) {
                    try {
                        String str = (String) t.getTransferData(DataFlavor.stringFlavor);
                        importString(c, str);
                        return true;
                    } catch (UnsupportedFlavorException ufe) {
                    } catch (IOException ioe) {
                return false;
            @Override
            public boolean canImport(JComponent c, DataFlavor[] flavors) {
                for (int ndx = 0; ndx < flavors.length; ndx++) {
                    if (DataFlavor.stringFlavor.equals(flavors[ndx])) {
                        return true;
                return false;
        class TableTransferHandler extends StringTransferHandler {
            private int dragRow;
            private int[] dragColumns;
            private BufferedImage[] image;
            private int row;
            private int[] columns;
            public JTable target;
            @Override
            protected Transferable createTransferable(JComponent c) {
                JTable table = (JTable) c;
                dragRow = table.getSelectedRow();
                dragColumns = table.getSelectedColumns();
                createDragImage(table);
                return new StringSelection(exportString(c));
            protected String exportString(JComponent c) {
                JTable table = (JTable) c;
                row = table.getSelectedRow();
                columns = table.getSelectedColumns();
                StringBuffer buff = new StringBuffer();
                for (int j = 0; j < columns.length; j++) {
                    Object val = table.getValueAt(row, columns[j]);
                    buff.append(val == null ? "" : val.toString());
                    if (j != columns.length - 1) {
                        buff.append(",");
                return buff.toString();
            protected void importString(JComponent c, String str) {
                target = (JTable) c;
                DefaultTableModel model = (DefaultTableModel) target.getModel();
                String[] values = str.split("\n");
                int colCount = target.getSelectedColumn();
                int max = target.getColumnCount();
                for (int ndx = 0; ndx < values.length; ndx++) {
                    String[] data = values[ndx].split(",");
                    for (int i = 0; i < data.length; i++) {
                        String string = data;
    if(colCount < max){
    model.setValueAt(string, target.getSelectedRow(), colCount);
    colCount++;
    public BufferedImage[] getDragImage() {
    return image;
    private void createDragImage(JTable table) {
    if (dragColumns != null) {
    try {
    image = new BufferedImage[dragColumns.length];
    for (int i = 0; i < dragColumns.length; i++) {
    Rectangle cellBounds = table.getCellRect(dragRow, i, true);
    TableCellRenderer r = table.getCellRenderer(dragRow, i);
    DefaultTableModel m = (DefaultTableModel) table.getModel();
    JComponent lbl = (JComponent) r.getTableCellRendererComponent(table,
    table.getValueAt(dragRow, dragColumns[i]), false, false, dragRow, i);
    lbl.setBounds(cellBounds);
    BufferedImage img = new BufferedImage(lbl.getWidth(), lbl.getHeight(),
    BufferedImage.TYPE_INT_ARGB_PRE);
    Graphics2D graphics = img.createGraphics();
    graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
    lbl.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
    lbl.paint(graphics);
    graphics.dispose();
    image[i] = img;
    } catch (RuntimeException re) {
    class TableDropTarget extends DropTarget {
    private Insets autoscrollInsets = new Insets(20, 20, 20, 20);
    private Rectangle rect2D = new Rectangle();
    private TableTransferHandler handler;
    public TableDropTarget(TableTransferHandler h) {
    super();
    this.handler = h;
    @Override
    public void dragOver(DropTargetDragEvent dtde) {
    handler.dropAction = dtde.getDropAction();
    JTable table = (JTable) dtde.getDropTargetContext().getComponent();
    Point location = dtde.getLocation();
    int row = table.rowAtPoint(location);
    int column = table.columnAtPoint(location);
    table.changeSelection(row, column, false, false);
    paintImage(table, location);
    autoscroll(table, location);
    super.dragOver(dtde);
    public void dragExit(DropTargetDragEvent dtde) {
    clearImage((JTable) dtde.getDropTargetContext().getComponent());
    super.dragExit(dtde);
    @Override
    public void drop(DropTargetDropEvent dtde) {
    Transferable data = dtde.getTransferable();
    JTable table = (JTable) dtde.getDropTargetContext().getComponent();
    clearImage(table);
    handler.importData(table, data);
    super.drop(dtde);
    private final void paintImage(JTable table, Point location) {
    Point pt = new Point(location);
    BufferedImage[] image = handler.getDragImage();
    if (image != null) {
    table.paintImmediately(rect2D.getBounds());
    rect2D.setLocation(pt.x - 15, pt.y - 15);
    int wRect2D = 0;
    int hRect2D = 0;
    for (int i = 0; i < image.length; i++) {
    table.getGraphics().drawImage(image[i], pt.x - 15, pt.y - 15, table);
    pt.x += image[i].getWidth();
    if (hRect2D < image[i].getHeight()) {
    hRect2D = image[i].getHeight();
    wRect2D += image[i].getWidth();
    rect2D.setSize(wRect2D, hRect2D);
    private final void clearImage(JTable table) {
    table.paintImmediately(rect2D.getBounds());
    private Insets getAutoscrollInsets() {
    return autoscrollInsets;
    private void autoscroll(JTable table, Point cursorLocation) {
    Insets insets = getAutoscrollInsets();
    Rectangle outer = table.getVisibleRect();
    Rectangle inner = new Rectangle(outer.x + insets.left,
    outer.y + insets.top,
    outer.width - (insets.left + insets.right),
    outer.height - (insets.top + insets.bottom));
    if (!inner.contains(cursorLocation)) {
    Rectangle scrollRect = new Rectangle(cursorLocation.x - insets.left,
    cursorLocation.y - insets.top,
    insets.left + insets.right,
    insets.top + insets.bottom);
    table.scrollRectToVisible(scrollRect);
    Edited by: Andre_Uhres on Nov 18, 2007 10:03 PM

  • Do I need to have data before performing Drag and Drop????

    I have gotten drag and drop working with Swing in JDK 1.4b2 using "URL-based" files instead of operating system native files. The way this was accomplished by creating a wrapper class that sub-classed File and would download the contents of the URL to a temporary file and then initiate a normal drag and drop operation using the normal java file mechanisms. However, when you have a large file, the operation can take too long since I am fronting all of the effort at the start of the drag. I would like to be able to delay the need to produce the bytes/files to give to the operating system until after there has been a successful drop, at which point I can do the heavy lifting and raise a dialog telling them that the action is commencing. As best as I can tell, you must have all of the data BEFORE any operation (which could be a potential design flaw!!)
    So, is there a way to get a hook that there has been a successful drop to a vm-external drop target before the VM gives the data over? Even if I create my own data flavor (which isn't well documented outside of Text types) won't I still run into the same problems? Am I just overlooking something simple?
    Thanks for your help.

    Hello
    I've had the same problem, but take a look at: http://foxtrot.sourceforge.net/
    You can use their API to start the long consuming time job (reading files from the network) and also to paint a progress bar, showing the progress in the Event Dispatch Thread.
    This is how I've solved my problem:
    I've passed a MyTransferable object to the startDrag method of the DragGestureEvent event.
    In the getTransferData method of MyTransferable object (that implements Transferable interface) I've used the Worker.post method of their API which reads the file from the network and updates a progress bar.
    The API lets the Event Dispatch Thread enter but not return from the listener method (getTransferData in my case), instead rerouting the Event Dispatch Thread to continue dequeuing events from the Event Queue and processing them (repaint the progress bar). Once the worker thread has finished, the Event Dispatch Thread is rerouted again, returning from the listener method.

  • Open a File in a JTextPane via Drag and Drop

    Hi,
         I have a simple JTextPane in a Swing App on Windows XP. I would like to know if it is possible for me to be able to add the functionality such that I can drag a text file to the JTextPane and it would open the file inside the Pane. Is this possible? If yes then how do I implement it? (I am not insisting on the app working on non-Win XP systems � so portability is not a concern.)
         I have tried to search for the drag and drop stuff but I am confused. First, which interfaces should I implement i.e. DragGestureListener, DragSourceListener, DropTargetListener or what?
         I would be grateful for any pointers.
    Thanks a lot,
    O.O.

    1. http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html - This link did have the information but has since been updated and no longer points to the relevant information that I have since used.
    So you where given a link with the appropriate informaton, but Sun has changed the information and you are blaming us for not helping? Unbelievable!
    Here is a link to the old tutorial:
    https://www.cs.auckland.ac.nz/references/java/java1.5/tutorial/uiswing/dnd/intro.html#importFiles
    Now tell us how that does not do exactly what you wanted?
    I really don�t know why some people waste their time here just providing you with linksBecause most people like yourself don't know how to ask a question. DnD is a complex topic. The only way to learn it is to read a tutorial and experiment. What a better way to learn than to play with a working example. You are given many working examples in the tutorial.
    You did not state wihich example you had changed. You did not state what problems you where having.
    The best you could state was "I'm confused". You where asked to clarify your problem/confusion but didn't. We are not mind readers so we couldn't provide further help.
    I agree I am wasting my time helping someone who doesn't even appreciate the effort made by the many individuals of the forum and I won't make that mistake again.

  • Combine Files Dialog 8.1.6--drag and drop broken?

    I just reinstalled Acrobat 8, and the Combine Files panel is "all whacky".
    If I drag one or more documents into the panel, they are added normally. But if I then add another batch of 1 or documents, the FIRST SET OF DOCUMENTS is added again.
    To be clear, if I drag documents 1.tif, 2.tif, and 3.tif into the Combine Files panel, I end up with (as expected)
    1.tif
    2.tif
    3.tif
    But if I then drag documents 4.tif and 5.tif into the panel (or any other set of documents), I end up with
    1.tif
    2.tif
    3.tif
    1.tif
    2.tif
    3.tif
    Adding files through the file chooser panel works fine. Can someone tell me if this is peculiar to my installation or if it is a bug in Acrobat Pro 8.1.6?
    Thx

    Sort of the same here:
    I just noticed that the standard "drag and drop" in combination with "cmd + tab" to switch applications no longer works on my MacBook Pro. Whenever I try to drag pictures (e. g. jpg) from Safari into a Keynote 09 presentation (switching from Safari to Keynote using "cmd + tab"), the dragged image simply hangs and cannot be dropped into Keynote.
    And here's the _truly weird_ thing:
    When I then use "cmd + tab" again to switch to the next app again, the Keynote window stays on top and I can suddenly move and drop the dragged picture again. How strange is that?

  • How to change mouse cursor during drag and drop

    Hi Guys,
    Iam performing a Drag and drop from Table1(on top of the figure) to Table2(down in the figure).
    see attached figure
    http://www.upload-images.net/imagen/e80060d9d3.jpg
    Have implemented the Drag and drop functionality using "Transferable" and "TransferHandler"using the java tutorial
    http://java.sun.com/docs/books/tutorial/uiswing/examples/dnd/index.html#ExtendedDndDemo
    Now My problem is that ,I want to make the 1st column in Table2(ie: Column2-0) not to accept any drops so that the cursor appears like a "No-Drop" cursor but with selection on the column cell during a drop action.
    Also when I move my cursor between "column2-0" and "column2-1",want to to have the "No-Drop" and "Drop" cursor to appear depending on the column.
    How can I achieve it using the TransferHandle class.Dont want to go the AWT way of implementing all the source and target listeners on my own.
    Have overridded the "CanImort" as follows:
    public boolean canImport(JComponent c, DataFlavor[] flavors) {
         JTable table = (JTable)c;      
    Point p = table.getMousePosition();
    /* if(p==null)
         return false;
    int selColIndex = table.columnAtPoint(p);
    if(selColIndex==0)
         return false;*/
    If I execute the above commented code,The "No-Drop" Icon appears in "column2-0",but no cell selection.Also If I move to "column2-1",which is the 1st column,Still get the "No-Drop" Icon there,also with no cell selection.
    for (int i = 0; i < flavors.length; i++) {
    if ((DataFlavor.stringFlavor.equals(flavors))) {
    return true;
    return false;
    Thanks in advance.....
    Edited by: Kohinoor on Jan 18, 2008 3:47 PM

    If you found the selection column based on the mouse pointer, then based on the column, you can set the cursor pointer as any one as below :
    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    setCursor(new Cursor(Cursor.HAND_CURSOR));

  • CS5 Bridge repeatedly crashing during drag and drop

    I've recently purchased Photoshop CS5 and I'm getting used to a new workflow using raw (DNG) images with my new camera. Since raw images pretty much must be browsed within Bridge (would be nice if Windows Explorer could recognize DNG files some day), I'm learning the ins and outs of working in Bridge.
    My problem has been repeated crashing of Bridge while sorting and moving around a bunch of images. I find it easier to view thumbnails in Bridge on one screen and use Windows Explorer on a second screen to create subfolders and as a place to drag-and-drop selected photos. I can usually move several groups of images to Windows Explorer before Bridge crashes but I'd say Bridge never runs for more than a minute or two between crashes. I've read a few other messages on this forum which have suggested holding down <ctrl> while starting Bridge to reset the preferences. That seems (though possibly coincidentally) to have changed the place where Bridge crashes from the StackHash module to the ntdll.dll module. The following is an example of the problem signature of one of these crashes in case this looks familiar or provides any sort of clue:
    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: Bridge.exe
    Application Version: 4.0.2.1
    Application Timestamp: 4bff9363
    Fault Module Name: ntdll.dll
    Fault Module Version: 6.1.7600.16559
    Fault Module Timestamp: 4ba9b29c
    Exception Code: c0000005
    Exception Offset: 0002e25b
    OS Version: 6.1.7600.2.0.0.768.3
    Locale ID: 1033
    Additional Information 1: 0a9e
    Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
    Additional Information 3: 0a9e
    Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
    Before anybody suggests I am running Windows7 Home Premium (x64) with an Intel i7 CPU, 8GB of RAM and a 1TB hard drive. I have all the available updates applied to the CS5 software, my video driver, and Windows itself. The problem is persistent and repeatable and rebooting and closing down all other applications have no effect.
    Am I the only CS5 user in the known universe having such issues or are there known problems dragging and dropping with Bridge?

    Rabbit of Caerbannog wrote:
      I find it easier to view thumbnails in Bridge on one screen and use Windows Explorer on a second screen to create subfolders and as a place to drag-and-drop selected photos.
    This may be causing the problem.  Drag and drop requires more resources of the OS and video card.  Can you use "move or copy to" instead and see it that works?
    Also, I can see no reason to use Windows Explorer to create subfolders and your method to drag and drop may cause other problems.  If you move files with an XMP file attached make sure it moves with it. 
    I think you are making it more difficult that you need to.  Also, Win. Exp does not display thumbs of Raw images as you mentioned. 
    If you want 2 browsers open click File/new window and now you have 2 copies of Bridge open.  Put one on each monitor.
    If you enter ntdll.dll in a web search you will see it is somewhat of a gereric hard drive error.
    Hope this helps.

  • Embed animate file in Dreamweaver, make the drag and drop stop working

    The drag and drop works fine when I open the Animate file, but when I embed it using the "Media > Edge Animate", it does not work. How can I solve this problem?
    I'm using an external js file.
    Thanks.

    Need you to share the dreamweaver project along with the edge animation, to check the issue.
    Regards,
    Vivekuma

  • ITunes 11.0.4 still copying files to media library after dragging and dropping while holding down "option"

    I'm having trouble adding media without automatically copying the file to the iTunes media libary after dragging and dropping while holding down "option."
    In Preferences > Advanced, "Copy files to iTunes media folder when adding to library" is checked. When I drag a file into iTunes while holding "option", the green "plus" icon disappears. However, iTunes still copies the file to media folder.
    Any suggestions?

    you can also try:
    I found that if I SCROLL down to the word 'playlist' and hover around the name, a 'show' comes up.  Click on the 'show' and everything magically appears.

  • Issue during drag and drop in vb

    Hi Uwe,
    I want an urgent help on the following scenario.
    When i do a drag and drop anywhere on vb other than a link or spot.The screen freezes and when i try to do at lead selection on any of the FPM objects at the same time I get an assert condition violated dump.After my analysis I think its still possess the drop event when i try to do any other action on fpm at same time.This issue is happening for me in ie11 but for ie10 its working fine.
    Please suggest some remedy!
    Thanks
    Siju

    Hello Siju,
    I am aware of multiple issues with drag and drop in the context of VB embedded in FPM/WD. In order to sort this out correctly and get the right solution I suggest to open a support ticket on BC-WD-CMP-FPM.
    Best regards,
    Uwe

  • Help with selecting files from script menu or drag and drop

    I found this scale images applescript online. It works great when a bunch of files is dragged on top of the script but I would like it to also work when a folder or group of files is selected in the Finder and I activate it from the scripts menu.
    I can't get my on run statement to work. I'm not really an Applescript guy so I'm really just asking if someone can help finish what I started in this on run.
    -- save in Script Editor as Application
    -- drag files to its icon in Finder
    property target_width : 120
    property save_folder : ""
    on run
    tell application "Finder"
    activate
    set folder_path to quoted form of (POSIX path of (the selection as alias))
    set theItems to every file of folder_path
    end tell
    end run
    on open some_items
    -- do some set up
    tell application "Finder"
    -- get the target width, the default answer is the property target_width
    set new_width to text returned of ¬
    (display dialog "Target width:" default answer target_width ¬
    buttons {"OK"} default button "OK")
    if new_width as integer > 0 then
    set target_width to new_width
    end if
    -- if the save_folder property has not been set,
    -- set it to the folder containing the original image
    if save_folder is "" then
    set save_folder to ¬
    (container of file (item 1 of some_items) as string)
    end if
    -- get the folder to save the scaled images in,
    -- default folder is the property save_folder
    set temp_folder to ¬
    choose folder with prompt ¬
    "Save scaled images in:" default location alias save_folder
    set save_folder to temp_folder as string
    end tell
    -- loop through the images, scale them and save them
    repeat with this_item in some_items
    try
    rescaleand_save(thisitem)
    end try
    end repeat
    tell application "Image Events" to quit
    end open
    on rescaleand_save(thisitem)
    tell application "Finder"
    set new_item to save_folder & "scaled." & (name of this_item)
    end tell
    tell application "Image Events"
    launch
    -- open the image file
    set this_image to open this_item
    set typ to this_image's file type
    copy dimensions of this_image to {current_width, current_height}
    scale this_image by factor (target_width / current_width)
    save this_image in new_item as typ
    end tell
    end rescaleandsave

    When items are dragged to your script's icon they are passed in to the on open handler, so this triggers:
    on open some_items
    and the dragged items are passed in as some_items
    In contrast, when you double-click on the script, or invoke it via the Script menu, this runs the on run handler:
    on run
      tell application "Finder"
        activate
        folder_path to quoted form of (POSIX path of (the selection as alias))
        set theItems to every file of folder_path
      end tell
    end run
    However, there's nothing in this block that actually does anything with the selection - you (dangerously) assume that the selection is a folder (you really should check first), and just set theItems to every file in that folder then you exit.
    So to do what you want you'll need to edit your run handler to filter the selection and pass files over to the code that does the hard work.
    You already have the basis for this - your rescaleandsave() handler, so it's just a matter of identifying the files in the selection and passing those over to that handler:
    on run
      tell application "Finder"
        set cur_selection to (get selection) -- get the selection
        repeat with each_item in cur_selection -- iterate through
          if class of each_item is folder then -- do we have a folder?
            set theFiles to every file of each_item -- if so, get its contents
            repeat with each_file in theFiles -- iterate through them
              my rescaleand_save(eachfile) -- and process them
            end repeat
          else if class of each_item is document file then -- do we have a file selected?
            my rescaleand_save(eachitem) -- if so, process it
          end if
        end repeat
      end tell
    end run
    So the idea here is that the run handler gets the selection and works through the (potentially-numerous) items. For each selected item it checks whether its a folder or a file, if its a folder it gets all the files within and passes them to the rescaleandsave handler.
    Note that this is not recursive - it won't catch files within folders within folders - since it only looks at the top level of selected folders, but it wouldn't be hard to rework the script to handle that if that's what you need.

  • How to address relative cell in TileList during drag-and-drop processing

    Is there a way to address the tile cell being dropped onto
    during the dragDrop function processing?
    private function myDragDrop(e:DragEvent):void {
    // e.whatthe#*&$
    <mx:TileList id="tilelist1" rowCount="9" columnCount="9"
    dragDrop="myDragDrop(event);" dataProvider="{anyOldAC}"/>
    If I'm dropping an object on the 3rd row and 5th column, I'd
    like to be able to manipulate the15th entry in the dataProvider
    without having to figure out the cell number from the component
    geometry and mouseX/mouseY. Using component geometries just seems
    WAY too brittle.

    Got the answer from Joan Lafferty on the FlexCoders forum:
    Use calculateDropIndex(event:DragEvent) that is a function
    for a TileList. In will return the index where the item was
    dropped.
    And that works:
    private function myDragDrop(e:DragEvent):void {
    var dropIndex:int = tilelist1.calculateDropIndex(e);
    Alert.show("dropIndex: " + dropIndex);
    Thanks Joan!

  • Drag and drop data from Numeric Control or Numeric Array to excel file

    I have two inquirries about drag and drop:
    1. How to drag and drop data from a Numeric Array or Numeric control to excel file
    2. How to drag and drop data from a Numeric Array or Numeric control to an Numeric array Indicator?
    The item 2, I tried it with the event structure, but it didnt work.
    Please do reply.
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    There are very good drag and drop examples that ship with LabVIEW.  Have you looked these over to see if they can be modified for your needs?
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • Can't drag and drop or copy multiple photos from iPhoto 9.4.2

    I am trying to export multiple edited (not originals) photo files from iPhoto to finder (actually to place in my Dropbox folder to share with friends/family). This used to be (in previous versions of iPhoto?) an easy case of dragging and dropping a selection of photos, or even a whole event, to the desired location in Finder. However, this no longer seems to work. It seems like it will as when you select and drag the photos, the 'green plus' symbol appears and remains when I move to drop the selection into finder, but then nothing happens. The photos dont transfer.  
    I can still drag and drop a SINGLE photo effectively and it saves in the edited form. I also tried selecting the desired photos, chosing copy and then paste in the desired location in finder. But when I chose 'paste' (right click, paste; or edit, paste) in the desired location, it only pastes a limited selection of the photos which I chose to copy. Not all the photos copy across.
    I cant understand why this is no longer possible as it used to be one of the classic examples of intuitive file actions that I love Apple for. The only way I can find now is to chose to export the selection or event (file, export) but this is much less easy and requires various decisions about the file quality etc. Using this option with various compression options, I have not been able to replicated the "original" file size which is displayed under 'info' for each photo in iPhoto.
    Any ideas please?
    Tom

    Thanks LarryHN thats helpful. I've just tried that and the export 'current' option does indeed re-create the edited photo file with exactly the same file size at that shown in iPhoto. I did consider the 'current' option but was put off by the loss of the metadata with this option. But maybe the old drag and drop approach was the same?
    It's curious that the resulting file size from 'export, current' is different (larger in the example I just tried) in comparison to that resulting from 'export, jpeg' (with either the medium or high option selected).
    OK there seems to be a couple of reasonable options available although neither is as nice as the simple 'drag and drop' which used to be available!!! Why would they remove that option?? (and yet not for single files?).
    Thanks
    Tom

Maybe you are looking for

  • Can not open all .pdf files in Yahoo Mail.

    Three computers using Windows XP and Internet Explorer can open all .pdf files in Yahoo Mail. The fourth and newest Computer with XP Pro, Internet Explorer, and the latest Adobe Reader can only open some, but not all, .pdf files in Yahoo Mail. Nothin

  • Wine problem (Diablo II)

    Hi, I used yaourt to install wine from the AUR, and am trying to run Diablo now. I tried running windowed, and it gets to the menu but after a moment it crashes. I attempted to run it fullscreen, and it gave me this (nothing opened): [daniel@daniel-d

  • LSMW- How to modify existing Master Records without using Recording/SBatch?

    Hi, Can anyone tell me of an alternative way to modify massive Vendor Master records except a transaction recording or Standard Batch Program? Actually my problem is that, i need to update Search Terms, whose lengths exceed the standard length for Se

  • Can't restore my system on new computer using rescue and recovery

    Hi there, Yesterday I got my Thinkpad Edge stolen from my apartment. I had been keeping backups of my system on external USB HDD  using lenovo's rescue and recovery tool. Today I got a new Thinkpad edge and been runing the rescue and recovery tool bu

  • Transporting table contents

    Hi ,      I have created a master data table and i need to transport its contents ( the table is already in quality ) from devlopment to quality server but it is not at all asking for a request.Please help me out