AppleScript that Finds Photos and Copys Created within Week

Hello,
I have three folders where I download photos. Each folder has different types of photos. I'd like to create a new folder that contains the copied most recent photos from my three folders. I was able to do this in workflow, but I'm not sure how to start the AppleScript.
Plus with workflow, it only works when I manually run it. Ideally, I'd like to see the results when I open the recent folder. Someone mentioned a Folder Action, but I can't figure out how to get it to work when the folder is opened.
I feel like i'm missing something fairly simple and i'm too tired to figure it out.
Please help!
Thanks!

I remember a script I wrote back in 2005. I had run a KDX-Server and I wanted a folder that contains aliases of my latest uploads. The way the skripts works is a bit ehm... strange since I was only able to create symbolic links using a shell script together with find, and later on theses symbolic links had to be converted to aliases so that kdx could recognize them...
(Find is pretty fast on searching for the latest files)
well, in addition a short manual
--hubionmac.com 07.02.2005
--#################################--Preferences--############################## ###--
property daycount : 4
property depthscanswitch : "off" --(on/off)
property dirnameinaliasname : "off" --(on/off)
global maxfolderdeep, folderkind, destination_folder, currentfoldername, tempfolder
--## Set all working directories
tell application "Finder"
set folderkind to kind of folder 1 of startup disk
try
set aliasfolder to (folder "recentuploadsaliases" of startup disk) as alias
on error
make new folder at startup disk with properties {name:"recentuploadsaliases"}
set aliasfolder to (folder "recentuploadsaliases" of startup disk) as alias
--error "A folder called \"recentuploadsaliases\" has been created at your startup disk."
end try
try
set temp_folder to folder "_temp" of aliasfolder as alias
set tempfolder to POSIX path of temp_folder
on error
make new folder at (aliasfolder as alias) with properties {name:"_temp"}
set temp_folder to folder "_temp" of aliasfolder as alias
set tempfolder to POSIX path of temp_folder
end try
set scangroupfolders to every folder of (aliasfolder as alias)
end tell
--## Now scan every folder
repeat with currentscan_groupfolder in scangroupfolders
tell application "Finder" to set itemname to name of currentscan_groupfolder
if itemname as text ≠ "_temp" then
--## clean the tempdir and the destination folder from aliases and links
tell application "Finder" to set destination_folder to original item of alias file "destination_folder" of currentscan_groupfolder
do shell script "rm -f " & quoted form of (POSIX path of (destination_folder as alias)) & "*"
do shell script "rm -f " & quoted form of tempfolder & "*"
tell application "Finder" to set the_folders to every alias file of currentscan_groupfolder
repeat with the_folder in the_folders
if name of the_folder ≠ "destination_folder" then
tell application "Finder" to set thepath to original item of the_folder
if depthscanswitch = "on" then
set maxfolderdeep to (character 1 of ((name of the_folder) as text)) as integer
else
set maxfolderdeep to 1
end if
tell application "Finder" to set thefolder to original item of (the_folder as alias)
set currentfoldername to (name of thefolder) as text
makesymlinks(thepath)
end if
end repeat
-- ## create aliases of symbolic links at the destination directory
tell application "Finder"
set these_ to every item of temp_folder
repeat with this_ in these_
if dirnameinaliasname = "on" then
set name_01 to name of container of (original item of this_)
set name_00 to name of (original item of this_)
set aliasname to name_00 & " @ " & name_01 as string
make new alias file to ((original item of this_) as alias) with properties {name:aliasname} at destination_folder
else
make new alias file to ((original item of this_) as alias) at destination_folder
end if
end repeat
end tell
end if
end repeat
on makesymlinks(the_folder)
set thepath to POSIX path of (the_folder as alias)
do shell script "find " & quoted form of thepath & " -ctime -" & daycount & " -maxdepth " & maxfolderdeep & " -mindepth " & maxfolderdeep & " -exec ln -s {} " & quoted form of tempfolder & " \\;"
end makesymlinks
Maybe this helps in a way.

Similar Messages

  • Tried to reinstall iPhoto library from external hard drive, it shows that the photos and events are there but there are no thumbnails and if you click on an image or video nothing comes up.

    My hard drive crashed recently and we took it to apple to get repaired. The apple employees said that they would have to replace the hard drive but they didn't have the equipment to get the data off my hard drive. So I took it to a computer store who had the right equipment after a month and a half of waiting they finally got all the data off my hard drive and put it on an external hard drive (Seagate Expansion Portable Drive). I then took it back to apple who replaced the hard drive. Now I'm in the process of reinstalling everything. I have never done a Time Machine back up or backed my laptop up to . Which I now will do very often once I've reinstalled everything. I have reinstalled all of my desktop images and folders as well as my iTunes library with no issues. However when i went to reinstall my iPhoto library it came up blank. I then Rebuilt the library several times and this was the result.
    It shows that the photos and events are there but there are no thumbnails and if you click on an image or video nothing comes up.
    Please help i have three years worth of images from holidays on here and would be devastated if i lost them.

    iPhoto cannot find the thumbnails or the original pictures.
    Go to your iPhoto Library in the Pictures Folder.
    Right-click on it and from the resulting menu, choose 'Show Package Contents'.
    This will bring you inside the iPhoto Library package. There you should see a Folder called Masters. Within that, there should be folder containing your actual photos.
    Are they there?

  • Access historical photos and videos stored within iMessages

    Is there a way to access all photos and videos stored within iMessages without having to go through each conversation hitting 'load more' again and again?
    For some of my long conversations the messages app crashes after a while returning me to the home screen so I can't view any older messages, videos or photos. It's too cumbersome having to do that anyway. I hope there's a simpler way as my messages storage size has ballooned and needs to be reduced.

    Has no one else got the same problem?!
    Whatsapp allows a detail view for any contact or group where it's possible to view all media exchanged between that contact/group. iMessage should have the same.
    iMessage seems to balloon in size quicker too.
    Whatsapp/Viber reduce media size/quality so take less space but iMessage doesn't. Each picture is sent full size for example 3-4mb for one taken with the phone! It should give size option like is given when emailing....should be quick implementation too since that already have that functionality. 

  • Is it true that i-photo and aperture are being discontinued

    I have heard rumors that i-photo and aperture will no longer be supported.  I use i-photo over any other photo processing program.  I would appreciate a clear answer to this so that I can explore what other programs are available that compare to i-photo.
                     Thanks Fred

    I took that as a given but can't find actual Apple statements to that effect.
    We don't have any direct Apple statements at all about the future of Aperture and iPhoto, Peter, only the announcement of the Photos.app at the WWDC. It's up to you, if you want to believe the second hand announcements, but then don't believe only the negative parts.
    From TD#s post.
    http://www.dslrbodies.com/accessories/software-for-nikon-dslrs/software-news/ano ther-one-bites-the-dust.html
    https://www.apertureexpert.com/tips/2014/6/28/comment-follow-demise-aperture
    https://www.apertureexpert.com/tips/2014/6/30/closer-look-photos-adjustments-bar

  • HT1766 lost my iphone and can't find photos and videos from camera roll on my computer. where are they?

    lost my iphone and can't find photos and videos from camera roll on my computer. where are they?
    thanks

    Where did you put them?
    These are not part of the sync process at all, as the manual tells you.  You should be importing them to your comptuer regularly as you would with any digital camera.

  • Is Photoshop Elements the program where you take photos and can create a video

    Is Photoshop Elements the program where you take photos and can create a video

    Thank you
    Jeffrey J. Zarnoch
    DMBA Fellow CCA
    Adjunct Professor/Philadelphia U
    LEED Green Associate
    Sent from my iPhone

  • How do you export photos and movies from iPhoto to your iPhone? I synced the device and noticed that some photos and some movies from iPhoto on my laptop were not transferred to my iPhone.

    How do you export photos and movies from iPhoto to your iPhone?  I synced the devices and noticed that some photos and movies on my laptop iPhoto were not transferred to my iPhone?

    I am not sure, which answer you found - so just in case:
    If you sync your iPhone with the iPhoto library, the photos will only stay on the iPhone until the next sync and they are not in the Camera Roll. If you transfer using the Photo Stream, they will only be vidsible in the stream, until they are replaced in iCloud by newer content.
    So, if you want to transfer the photos permanently, save them to the Camera Roll.

  • Can anyone recommend recovery software to find photos and videos that were taken on the iPod touch before resetting back to factory setting?

    My iPod touch was Connected to the computer to sync, but somehow ended up resetting everything to factory settings. When I checked contents, everything after the last date I synced is gone. I am most upset about photos and pictures taken on our vacation.
    How can I get all my photos back?
    Thanks.

    I don't know -- scams? You should always keep a backup of photos and data elsewhere; did you not do this? Photo Stream is the easiest way, in which case they should have been on your PC waiting for you.

  • Photo and iphoto create albums?!??

    I downloaded iphoto with the misunderstanding that it would let me organize my photos, something i have been waiting for since i have started using the ipad2.  I went through support and found that you must go through just plain Photo to do so.  Okay fine, except that for some reason I dont have the update that allows my Photo app to create new albums.  Cant find this update anywhere...help!!

    Hi Terence.  When I double-click on "All Photos", I have just a bunch of unorganized photos.  I click the back arrow and it just takes me back to showing the albums.  The only albums it shows are "All Photos" "Faces" "Last Import" and "Panoramas".  I have all of my photos in separate individual folders.  Shouldn't Photo show them as individual albums rather than one whole giant album of unorganized photos?  And why does Photo show all of my named photos as "Untitled"?

  • My photos are not working, any recently taken photos won't show, they're just like blank grey pictures & all my photos cannot be uploaded or loaded into an editing tap, it says error, cannot find photo, and the last photo I take ends up being repeated!

    someone please help me! I just traveled to hong long and the minute I arrived something wrong was happening with my photos, I can't take any new photos because if I did they either get repeated or just be shown as grey pictures and when I try to upload one to a photo editing app it says "error cannot Load photo" and the same happens in twitter and Facebook! this has been found on for Like more than a week now, even when I want to set a picture as my profile picture in man it ends up zooming the picture way more than how I chose it in the border,, I would like to be able to take good photos again, any help?

    1. You did not get an error message telling you that your iPhoto library was getting full. You got a message telling you that your HD was getting full, right?
    OS X needs about 10 gigs of hard drive space for normal OS operations - things like virtual memory, temporary files and so on.
    Without this space your Mac will slow down as the OS hunts for space on the disk, files will be fragmented, also slowing things down, apps will crash and the risk of data corruption - that is damage to your files, photos, music - increases exponentially.
    Your first priority is to make more space on that HD. Nothing else can be done until you do.
    Purchase an external HD and move your Photos and Music to it. Both iPhoto and iTunes can run perfectly well with the Library on an external disk.
    Your Library has been damaged from being run on an overfull disk.
    How much free space on it now?

  • Finding photos and editing with Photoshop

    to locate a photo in iPhoto library I use Spotlight to search for it - why doesn't iPhoto show in the info window the path to the selected photo? Is there a quick way to locate a particular photo in iPhoto library?

    Terence,
    You set up PS to be the external editor in iPhoto's preferences.
    Once you set up PS there, you can control click on an image in the library and choose any of the editing options: edit, edit in window, edit in full screen, edit with PS.
    If you edit with PS make sure to "save" the image with the same file name and flattened. Do not "save as" unless you want to save a layered file with a different name to a location other than the iPhoto Library.

  • TS3276 I cannot send any email that has photos. and cannot drag photos to desktop

    I cannot send any email with photos attached.  Also cannot drag photos to desktop. keeps asking for password or email sent is "failed"

    Thanks Larry, I am using the default account that was used by the previous version of iPhoto, I did not change any settings when I installed 11. The program deos not seem to give me an option to use an alternate. When I try to send photos I receive a message that the program does not recognize my username/password as follow; 
    "The email server didn’t recognize your username/password combination."

  • Is there a program that finds hardware and OS problems?mid-2012 pro

    What about spywear?... my answering machine turned on then router was accessable to my laptop!!!! I now keep the mac router unplugged when not in use.
    Also, the 10.4.11 pro USB out to a perifferial microprocessor (arduino uno R3) has stopped communicating in either USB port How can I check to see if it works. Both USB ports r/w to flash drives. So what to do now?

    I've never actually done this, but don't think it will work for the purpose of running a task in a regular app like Synk Pro. Launching Synk Pro - even, I would think, from a logout script - will cancel logout. Of course, if Ham1000 is willing and able, he could probably replace Synk Pro with a call to rsync from a logout script:
    http://www.bananica.com/Geek-Stuff/Synchronize-two-folders-on-a-Mac-with-Rsync/
    Interesting idea...

  • We have iTunes on our computer and there are three of us that log in and out on a weekly basis. All of my brother's songs were gone and replaced with mine, and we all share songs now, how do we get this to go away? We all want our songs back!!!

    I find this extrememly confusing. I have no idea how to get out songs to go back to our accounts, or if it is even possible. My borhter had 400 songs and now htye have been replaced with mine! Help!

    How to use multiple iDevices with one computer

  • Find a specific paragraph style within a table and apply a specific cell style?

    I'm a total beginner when it comes to scripting, but I would like to create a script that finds the paragraph style "resultsUL" within a large table and applies the cell style "female". Sure wish the find/replace was able to account for cell styles as well as paragraph and character styles. Is anyone willing to help me with this? Thank you!

    Hi,
    I do it quickly defining a simple research on the "resultsUL" para style and using a loop with QuicKeys as:
    Cmd-0 is a shortcut associated to the "female" cell style.
    So, What I do: search the para style (Cmd-option-F) and apply the cell style, then search again…
    As easy to do with QuicKeys, I think that can be easily done with a [JS] (faster process!).

Maybe you are looking for