AppleScript: Move the oldest Item of a folder

Hi,
i'm a newbie in AppleScript and trying to get my simple Script running, but it doesn't want.
The Script should look into "Folder_1" and should move only the OLDEST Item (File or Subfolder) in this Folder to another directory called "Folder_2"
But this is not running, some Ideas?
Code:
tell application "Finder"
  activate
  set sourceFolder to "System:Users:Administrator:Desktop:Folder_1"
  set destinationFolder to "System:Users:Administrator:Desktop:Folder_2"
  move oldest item 1 of folder sourceFolder to folder destinationFolder
end tell
Any Ideas?
It would be nice if someone can assist me in my first steps.

Better formatted:
set homePath to (path to home folder) as text
tell application "Finder"
     set sourceFolder to folder (homePath & "Desktop:Folder_1")
     set destinationFolder to folder (homePath & "Desktop:Folder_2")
     set creationDates to creation date of items of sourceFolder
     -- Which item is the oldest?
     set theOldestDate to item 1 of creationDates
     set j to 1
     repeat with i from 1 to count creationDates
           set thisDate to item i of creationDates
           if thisDate < theOldestDate then
                 set theOldestDate to thisDate
                 set j to i
           end if
     end repeat
     move item j of sourceFolder to destinationFolder
end tell

Similar Messages

  • If I move the oldest 2/3 of my iPhoto library to an external hard drive, will I still be able to access those older photos? I assume that I will be able to select the source (internal hard drive or external hard drive)?

    If I move the oldest 2/3 of my iPhoto library to an external hard drive, will I still be able to access those older photos? I assume that I will be able to select the source (internal hard drive or external hard drive)?

    Yes, if you have a second library.
    Here's one way to do what you want:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    Now you have two full versions of the Library.
    3. On the Internal library, trash the Events you don't want there
    Now you have a full copy of the Library on the External and a smaller subset on the Internal
    Some Notes:
    As a general rule: when deleting photos do them in batches of about 100 at a time. iPhoto can baulk at trashing large numbers at one go.
    You can choose which Library to open: Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    You can keep the Library on the external updated with new imports using iPhoto Library Manager

  • How can i move the itunes appdata from music folder to another folder?

    I want to get rid of all the database files in my music folder as other applications scan this folder for new music and it takes them forever to scan the itunes folder in the music folder because of all the folders for artwork etc.
    i thought that is what the %username%\appdata folder is for?!
    the help documents on the apple page just show me how to move my music, which is in the right place, but not the database xml and covers...

    Move the iTunes Library elsewhere, launch iTunes with the Shift key held down, and point it there.
    (60614)

  • How can we move the 'application data\apple computers' folder to another location

    We use roaming profiles and the Application Data folder is stored on a network drive with restricted space (500MB).  This has not been a problem in the past but since we've been rolling out iPad's & iPhones, this restriction is becoming a problem as iTunes download's ios updates and stores device backups in 'application data\apple computers' folder (and not in the media library).
    Does anyone know how we can move this 'application data\apple computers' folder to another location or force iTunes to store the downloads/updates in the media library (which can be moved)?
    Thanks very much in advance for any help.

    Move the iTunes Library elsewhere, launch iTunes with the Shift key held down, and point it there.
    (60614)

  • Recently purchased a scanner which I connect my iPad to.  everything scanned goes into iPhoto. I purchased FileApp Pro to place scanned items into files. I still can't move the scanned items to a file.  Help!

    Scanning items into iPad. Scanned items go directly to iPhoto. Purchased FileApp Pro to create file folders on iPad. Still cannot move items from iPhoto to file folder.  Help?

    Is this a NAS type of setup (of which I know very little)?  Mine is not a response based upon strong technical knowledge but iTunes seems to have problems with those.  Just about everybody has issues with iTunes but you say it is not fit  for the purpose.  What is that?  I bet for 99% of people it does.  Not  everybody has 8TB collections they are trying to use with a RAID structured  external server. iTunes is really a mass consumer piece of software.  Yes, many people have expanded beyond internal drives, but NAS arrangements seem to add levels of complexity beyond a direct external drive that is Mac formatted and at most served by an Apple brand wireless router which I suspect is probably how everything is tested. Anything more is fortuitous in terms of support.  Except that you say the library files are on the external drive too it sounds to me like the server is asleep when you say it cannot find files and then suddenly can when you go to find one.

  • How can I move the download backups and backups folder to a new location

    I am using Lightroom 4.3 on a windows 7 64 windows computer with two hard drives.  One dedicated to running programs and the larger one for storage of all my other stuff.  Well my backups and download backups folders are on the smaller drive and I need to move them to the other larger drive. Can I do this without totally freaking Lightroom out?  Thank you so much for your help.

    I am not familiar with the technical term "freaking Lightroom out", however, Lightroom doesn't care where the backups are. You can do anything you want with them, and Lightroom will work fine.

  • When ever I right click on the menu item "open containing folder" in the downloads window, it only opens the 'My Documents' folder. It never goes any farther than that. How do I fix this?

    Open 'Tools----downloads'.---Right click on any downloaded file that is available in the list.---click on 'Open Containing Folder'
    Results in opening the My documents folder.
    Not in the folder I have listed in Tools ---Options --- General---downloads---Save files to:

    You can use this extension to modify the menu.
    *Menu Editor: https://addons.mozilla.org/firefox/addon/menu-editor/
    You can also achieve this with code in the userChrome.css file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    The customization files userChrome.css (interface) and userContent.css (websites) are located in the chrome folder in the user profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #context-sendimage,
    #context-sendvideo,
    #context-sendaudio { display:none!important; }</nowiki></pre>

  • Is there anyway to move the menu items on the left?

    In help I found this, "You can’t rearrange the application menus on the left."  Is anyone aware of any possible way to do this?  Thanks.  Melody

    When Mac Help says you can't ... you can depend on it telling you the truth.
    Mac OS X 10.6 Help: The menu bar 
    "The menu bar runs along the top of the screen.
    On the left end of the menu bar are the application menus. The name of the application you are currently using appears in bold next to the Apple menu. There are several other application menus, often with standard names such as “File,” “Edit,” “Format,” “Window,” and “Help.”
    On the right end of the menu bar are menus represented by icons. These menus show the status of your computer or give you quick access to certain features.
    You can add some icons to the right end of the menu bar. For example, in the Sound pane of System Preferences, you can select a checkbox to show a volume slider in the menu bar. Some applications let you add an icon to the menu bar during installation.
    To rearrange the menu bar icons on the right end of the menu bar, hold down the Command key while dragging the icons. To remove them, hold down the Command key and drag them out of the menu bar.
    You can’t rearrange the application menus on the left."

  • C3-Move the SMS to different folder

    Hi,
    I can see the option of Archive the SMS which will transfer the SMS in the Archive folder.
    Is there any way, I can move the SMS from Inbox to folder other than Archive?
    Thanks.

    I don't know why nobody answered this question? I used to do this in my Nokia 6234 and I think the question is straight forward. Please reply..t will be useful for me...as I was using this feature frequently in my old mobile.
    Thanks.

  • What is the proper way to move the iTunes (v11) Media folder to an external USB HD?

    What is the proper way to move the iTunes (version 11) Media folder to an external USB HD?  I have tried to following listed instructions, but although I can get the songs listed, their locations are not found.

    Tried the option key, but it would not let me select the copied iTunes folder.  Also changed the path for iTunes Media Location folder.  But still iTunes is not happy.  I could try the alias route, but I don't have an iTunes folder that iTunes is happy with to point it to.  All of the songs and even the playlists will come up, but it seems some form of the folder and its files must remain on the internal hard drive.  But I want to move it off because it is out of space.  Any other thoughts?
    I have all of the music etc files what I do not want to lose is the playlists.  I don't care about the play counts.  I would be glad to reimport all of the songs to the newly designated folder, but won't I lose my playlists?
    Thanks for your help.

  • When I drag the update to my applications folder it says this error message: action cannot be completed because you not have suficient security privilages for some items.

    I've downloaded the latest version of Firefox, but when I try to move the icon to my applications folder (MAC) I get an error message: cannot be completed because you don't have sufficient security privileges.

    https://support.mozilla.com/en-US/kb/Installing+Firefox+on+Mac

  • In 10.10 the "recent documents" pulldown does not display actual recent items--it shows the same items time after time. How can I fix that?

    In previous versions of OS 10, the "recent items" pull down from the Apple icon (top left) actually showed recent items.  In this version, 10.10, the same items display time after time rather than displaying recent items.  How can this be fixed?

    Back up all data before proceeding.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Containers/com.apple.corerecents.recentsd
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item selected. Move the selected item to the Trash. Log out or restart the computer and test.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • How do I move photos from my Windows PC folder to my wife's ipad 2?

    Previously I had saved the photos from her ipad to a regular folder on my PC (without itunes) before upgrading her ipad from IOS 4.5 to 7 (which required installing itunes on the PC).  I made a back-up of her ipad with itunes that seemed successful before upgrading the IOS.  When I went to upgrade the IOS, another back-up was made and IOS 7 was installed, but itunes encounted some problem restoring the last back-up.
    1.  Is there a way to restore the 1st back-up I made instead of restoring the one that seemed to have errors?
    2.  If 1 is not possible, then how can I move the photos from a regular folder on my PC to my wife's ipad?
    The problem I am encountering doing this via itunes is that I have since connected my daugther's ipod to my PC which made a back-up of all her stuff.  When I connect my wife's ipad to the PC with itunes, it seems to want to automatically sync everything and starts copying all the apps on my daughter's ipod to my wife's ipad.  This is NOT what I want to do.  I simply want to copy the photos from the PC folder (which don't appear to be on itunes, unless I am missing something).
    Thx

    Hello Paul,
    I would reccomend that you take a look at this article on how to sync your photos using iTunes.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    Hope that answers your questions,
    -Griff W.

  • How to ignore credit amounts in oldest item credit check

    Hi,
    We've had an order that got put on hold because of the oldest item credit check.  The item is older than 15 days (our configuration setting), but the item is a credit memo, not an invoice.  Is there anyone to change this credit check so it will only block oldest items that have a debit amount? 
    Thanks in advance!
    Karla

    Thanks....
    Anyway, I have to wait till the Credit Card's bank process and recorded formally in their list, then I can only delete the master card in my phone. Well, habe to delete the card in Microsoft website  first, then i can only delete it in my phone after a few time "refresh" 
    Thanks for ur help 
    Happy CNY

  • IPhone email not being sent but not in Sent Items or Outbox Folder

    When I press send on an e-mail on my iPhone, the e-mail often disappears completely. It does not attempt to send, and is not in the Sent Items or Outbox Folder.
    This has happened on a number of occasions on Microsoft Exchange accounts at work and I definitely had a full 3G/4G signal. Iphone IOS is up to date.
    You would think that if it didn't send the message then it would be in the Outbox until you get a signal and then it would send it?
    But no it just completely disappears.
    Does anyone know of a fix?
    Stevie

    So I've been doing more tests. Maybe this will help diagnose a little more:
    The users email is appearing in workgroup manager under /Info / Email Address.
    I have changed the audience workflow property to one of my test email addresses - the message sends to the audience correctly.
    I have modified a workflow and changed to $$User Email Address>> to explicitly be an email as opposed to the variable - the email was sent to the user, but the user's name was not in the email header. Instead it displayed the same as before: [email protected], , [email protected] I also looked at the results in the xgridagentd log under the console and the address showed up correct there.
    If I do not explicitly put an email in as $$User Email Address>> the xgridagentd log shows something as follows:
    Mon Feb 25 09:38:17 server.school.edu xgridagentd[43] : Notice: agent task "9964" started for user "podcastxgrid" executable "/usr/bin/pcastaction" arguments (\n mail,\n "--basedir=/Shared Items/Podcasts/Recordings/FD5ED310-A75B-45F2-8BC6-83F0D9F123AF",\n "--from=",\n "--to=[email protected],,[email protected]",\n "--smtp=smtp-auth.school.edu",\n "--body_file=mail.txt"\n)
    Mon Feb 25 09:38:18 leo.gac.edu xgridagentd[43] : Notice: agent task "9964" finished for user "podcastxgrid" executable "/usr/bin/pcastaction" arguments (\n mail,\n "--basedir=/Shared Items/Podcasts/Recordings/FD5ED310-A75B-45F2-8BC6-83F0D9F123AF",\n "--from=",\n "--to=[email protected],,[email protected]",\n "--smtp=smtp-auth.school.edu",\n "--body_file=mail.txt"\n)
    Notice that the from and to are blank.
    I am using an external SMTP server, which we already have running and at least seems to be sending to whoever I explicitly list. It seems like the $$User Email Address>> variable is not getting any info.
    Let me know if you have any ideas! Any other logs to check?
    Thank you to any ideas. I am stumped!

Maybe you are looking for