Automator copy only certain file extensions

Hi,
This should be so simple. I have tried using automater to search and filter ONLY .mp4 and .mov file extensions in a certain folder and copy it to another folder. Automator seems to work fine copying from folder to folder but copies all files to the new folder.
For the life of me, I can't seem to get the correct script/workflow working. This should be so simple.
Could someone please clue me in on how to do this? I would truly appreciate it!
Matt

You need to test if the file exists:
tell application "Finder"
          set theList to (every file of folder "Documents:_RENDER FARM" of home whose name extension is in {"mov", "mp4"})
          repeat with theFile in theList
                    set fileName to do shell script "basename " & quoted form of POSIX path of (theFile as string)
                    set x to ((folder "Documents:Google Drive:Cinema 4d:_from render farm" of home as string) & fileName)
                    if not (exists x) then
                              copy theFile to folder "Documents:Google Drive:Cinema 4d:_from render farm" of home
                    end if
          end repeat
end tell

Similar Messages

  • Gzip only specific files extensions over sockets

    I am writing a socket webserver class that gzips only HTML files back to the browser (client). If the HTML file contains any images, I will have to send that over uncompressed. I am using GZIPOutputStream for my HTML objects, and a regular DataOutputStream for my other objects. None of my images show up correctly when I use DataOutputStream alone, but when I also gzip them, they show up fine. Also, all the images/html files show up fine if I exclude all the gzipping altogether. So it seems as though I have to either gzip them all ... or none at all.
    Is there a way to gzip only certain file extensions?
    Thanks!

    None of my images show up correctly when I use DataOutputStream alone, but when I also gzip them, they show up fine.Perhaps you aren't calling flush on the DataOutputStream (but the GZIP stream is) ?
    So it seems as though I have to either gzip them all ... or none at all. Probably not, I believe there is just an error in your code.
    Is there a way to gzip only certain file extensions?Sure,
    if (fileShouldBeGzipped(file.getName()))
      sendGzipFile(file);
    else
      sendFile(file);Of course, you must provide the fileShouldBeGzipped logic.
    Are you really implementing a webserver? That is, is it using http? If so, the standard practice (protocol) is that a client adds a header field which states what type of content encoding it can deal with in the response (i.e. gzipped content). If the server is capable, it replies with its own header stating the content is indeed gzipped along with the gzipped content. This way the client knows that it must decompress the data before doing something with it.

  • FileDialog (filtering for certain file extensions)

    I have used JFileChooser in the past and was modifying my code to use FileDialog instead as it looks better, looks like the one used by every other Windows program and takes less code to get the job done. My
    question is how to filter for certain file extensions in FileDialog as you can in JFileChooser. I cannot seem to figure out how to, so any help would be highly appreciated. Thank you.
    P.S. Also if you know how to turn off all files like you can in JFileChooser, that would also be extremely helpful.

    Go to the JFileChooser tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html and skip to the section entitled "Filtering the List of Files". That sounds like it should answer your question.

  • How to restore only certain files

    i did an erase and install (hopefully to remove a problem that we and the apple store genius have ben unable to find. . i did not yet use time machine to migrate all files to the macbook because i want to migrate only certain files.  how do i migrate only some files selectively, and not all of them as would happen in doing a complete restore ?

    Yes. You'll need to use the TM "Star Wars" interface to locate the files and restore.
    Start by reading Pondini's TM articles here; http://pondini.org/TM/Home.html
    FAQs 15, 15A and 16 are particulary of interest.

  • Premiere Pro CS5 crashing when exporting (only certain file types)

    Hi
    I have found that when I try and export media in Premiere Pro CS5, it often crashes during the export. It says
    It's only certain file types. For instance, Vimeo HD seems okay but Vimeo SD always crashes mid-export. MPEG is okay too, but MPEG2-DVD always crashes.
    Sometimes it says this: "Error Compiling Movie - Unknown Error" but doesn't throw me out of Premiere altogether.
    Other times it crashes altogether and Windows gives me this error message: "Display driver NVIDIA Windows Kernel Mode Driver, Version 258.96 stopped responding and has successfully recovered". Premiere Pro then stops responding so I have to re-open it and start exporting again.
    I have checked there are no gaps in my timeline and I have rendered the whole work area. Besides, I doubt it's anything that I'm doing wrong with the project itself because it's exporting fine in some formats.
    I am also experiencing random crashes when editing too. Not that often, but occasionally it throws me out - and twice it has made the whole screen go crazy, with weird dotting across the screen (it's scary, it looks like the monitor itself has broken!).
    Any help would be appreciated!
    Nick
    PS I have a pretty decent new PC - Dell Studio XPS, 8GB, 2x1TB drives, etc. Premiere itself is working great, except for these crashes.

    Some drivers do not work well in some systems... so go to nVidia and try a different (usually newer) driver for your card
    These notes are for Encore, but they MAY also work in Premiere
    Long File Names or odd characters Cause Crashing http://forums.adobe.com/thread/588273
    And #4 Here http://forums.adobe.com/thread/666558?tstart=0
    And This Message Thread http://forums.adobe.com/thread/665641?tstart=0

  • After back up, can i choose only certain files to restore?

    I am currently backing up my entire Macbook so i can reinstall Leopard. I was wondering after the reinstallation of Leopard if i can be able to choose only certain files like my music, pictures, ETC? Because i would like to start to use the root account.

    As Duane has mentioned, you will be able to access Time Machine backups from your computer by setting Time Machine up again and choosing your Time Capsule as the backup disk. You will need your TC disk password as well.
    I think I recall a user who said he could not access his backups after reinstalling the operating system on his machine. He couldn't remember the TC password and...he could not go back into KeyChain Access to try to retrieve his password because the application had been reinstalled, erasing the old stored data. Keep your TC password in a safe place as you will not be able to access the TC without it.
    In the event that you are having difficulty with restoring Time Machine backups, you also have the ability to use Migration Assistant to move files back from the TC to your computer. You will need your TC password to do this as well. You won't be able to selectively choose just the files you want to move, but you can always go back into your hard drive and delete the files that you don't want or need.

  • Using Automator to Copy Only New Files to a Destination Folder

    Hello,
    I need an AppleScript to copy a source directory (including all subfolders and files) to a destination folder, but one that checks for duplicate files and only copies files across from the source directory if they aren't already contained in the destination directory.
    I have a script that checks the files, but it only copies files from the source directory and ignores all subfolders and the files within those.
    Can anyone help?
    Thanks
    Reynell79

    red_menace wrote:
    You can create a Service workflow to get the folder(s).  The workflow would consist of actions to save the input items to a vatiable (so they can be refiltered), then get the input items, apply a filter, and move the resulting items - for example:
    Service receives selected folders in Finder
    Get Folder Contents
    Set Value of Variable { Variable: Original Items }
    Filter Finder Items { Find files where: kind is music }
    Move Finder Items { To: Automatically Add to iTunes }
    Get Value of Variable { Variable: Original Items } ( Ignore Input )
    Filter Finder Items { Find files where: kind is image }
    Move Finder Items { To: Album Artwork }
    ...repeat the Get/Filter/Move actions as needed for other filters
    Thanks, the "Set Value of Variable" concept is what I was missing. It almost works. The music files get moved, but then it says the workflow encounters a problem and the image files aren't being moved. I'm assuming it's an issue with steps 5-7. Thoughts?

  • Copying only data files from old MacPro?

    I have a 500GB drive from an older Macpro that I want to copy files from to get them onto a new iMac SSD. I only want to copy the data files, no applications, preferences, Library files, etc.
    The Macpro no longer boots, though I have a hard drive docking station that I can put the drive into so I can connect it to the new iMac.
    1. What is the best way to copy just the data files from the old drive to the new iMac?
    2. How reliable is this? Is there any chance that it will not copy some of the files over?
    Thanks!

    I just want to make sure that I'm not missing any files. After I drag them over I can put them into the trash so I know they were copied over. Any other tips for doing this? Is there a way to search for all files on the Mac to ensure that there are none that I might miss?
    Thanks.

  • Finder SEARCH help... how do I find only a certain file extension?

    I have a big back up of my fonts, with layers and layers of nested folders, and I want to select all .otf, and then all .ttf fonts... only I'm having trouble getting FIND to do that.
    I tried just putting ".otf" in the search field, but no results.
    So, leaving the search field BLANK and selecting the correct FOLDER:
    I chose "font format" from the "other" menu, and tried ".otf" and "open type", but again, nothing.
    I even chose "extension is" from the "other" menu, and typed in ".otf".
    And, well, I'm out of ideas. This wouldn't take me forever to do it manually, but I just need to FIGURE OUT HOW TO DO THIS!!
    What am I doing wrong?

    Well, I may be stupid. I forgot to say that this is an internal HD, but not my main HD, and I had it EXLUDED from Spotlight in sysprefs because it's 1T, and I didn't want it mucking up my day-to-day Spotlight searches.
    To that end, I knew it wouldn't be searhed if I used Spotlight, but I assumed if I used COMMAND-F, and targeted the exact folder, it WOULD search it. Is that not right? I mean, COMMAND-F finds stuff on DVDs and Flash Drives and stuff. Because I'm not getting ANY results for this one folder...
    Apologies if this is a wild goose chase.

  • IMovie won't recognize certain 'File extensions' ??

    Hi,
    can anyone help here. I use Handbrake to compress Movie files before I use Quicktime to 'export to web' option, then import to iMovie to then edit before submitting ti iTunes ( keeps the size down but still have good quality ). Anyway even though the files from Handbrake have either a .mov or .m4v extension iMovie won't recognize them, but if I then use QT export to web ( which in turn makes a folder with the new files inside ) which have the .m4v, iMovie will see it !!
    Any ideas please.
    The compressed file under Handbrake is small but good quality ( 2.3Gb down to 178Mb ) but if I use QT it then becomes even bigger ( 539Mb ) !!!!!
    Steve

    I'm new to Handbrake so could you tell me what do you mean by 'Don't include extraneous data tracks' ?
    Most people use HandBrake to convert DVD content (usually multiplexed M2V video and AC3 audio) to iPhone, iPod, TV, iTunes/Front Row files for viewing and/or iMovie '08 compatible files for editing. Since DVD content usually contains chapter data and the default setting for Apple device presets like TV normally default to include the chapter track data and (in older versions) may default to include an extra AC3 "passthrough" audio track, the output from such conversions are not supported by iMovie '08. If this is true, then re-exporting the content as you described would remove the extraneous data and explain why the files are incompatible with iMovie '08 before export and compatible after.
    However, you have not confirmed that the incoming files are, in fact, stored on DVDs or indicated which specific settings are being used for your HandBrake conversions. iMovie '08 is only "edit" compatible with files containing DV, AIC, Motion-JPEG, Photo-JPEG, and certain profiles of MPEG-4 or H,264 video compressed data. So there is always a secondary possibility here that you are selecting an incompatible form of output form HandBrake and then using the "Export for Web" option to accidentally convert the incompatible compression format to a compatible one since this option exports to H.264/AAC by default.
    If you have a much better way of doing this I am all ears especially if it makes my life easier, I am on a steep learning curve here ( sending video podcasts to iTunes but in good quality ).
    The normal approach would be to select the iPod preset within HandBrake (or within QT Pro, GarageBand, MPEG Streamclip, etc. if the source file is QT compatible) and convert directly to an iMovie '08 compatible file. The iPod preset would create a file equivalent to the "Desktop" (1500 Kbps) file created by the "Export for Web..." option but, as previously mentioned may contain a "chapter" track if you fail to turn it off. If you want a smaller output file, then all you have to do is reduce the target data rate in HandBrake. If you are currently editing the equivalent of the iPhone file (900 Kbps) using your current work flow, then reduce the target average bit rate to 900 or 1000 Kbps before exporting from HandBrake. Basically, this approach is faster since you do not have to export the data twice. On the other hand, it is a bit more complicated since you have to manually ensure any extraneous data tracks are de-selected and that the correct compressing preset/settings are selected.

  • On install, itunes to select only certain files

    I only want itunes to include certain types of files (M4A and NRG) when i install itunes. How can I do this?

    Well, I probably should have searched the extensions first. I did find this one, which will be very helpful in some cases: http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1093470#

  • Reading only certain files from Movies folder?

    Hello all,
    I have an external hard drive connected to my Time Capsule that is loaded with a bunch of VIDEO_TS folders of all my DVDs, and I have that drive aliased in my "Movies" folder on my MacBook Pro, so when I open Front Row, it points to my external HDD, and everything is hunky-dory.  But I also have other files in this HDD (a bunch of JPG files) that are also being seen by Front Row.  For reasons that are too boring to get into, I don't want to separate the files into different locations, I would like to keep them together.  But my goal is to be able to somehow block Front Row from seeing these JPG files and just display the list of my DVDs instead.  Is there any way to tell my alias to block out the JPGs, or some way to hide the JPGs from that particular alias, or something along those lines?
    Thanks for any help I may get!
    Ben

    The only way I can immediately think of is the way I have arranged it, whereby I don't use an alias of the external HD, but aliases of each individual TS folder.
    That certainly avoids showing non-video files in the Movies folder.

  • Automator Copy Finder Items - file couldn't be saved error

    I have a simple automator sequence that suddenly stopped working for no apparent reason.  Copy Finder Items has started returning an error "the file xxx couldn't be saved to the folder yyy"  Happens for different files and folders. Can't see anythng that's changed.  Any ideas?

    I'm currently having the same issue, and have had it with mulitple automator scripts on multiple computers, but it's not fixing itseltf. Anyone know what this error could be?
    I've noticed that I get the above error most often after getting and then correcting  permissions errors in the same workflow. Any help would be most appreciated.
    Thanks!

  • Restoring only certain files after reinstall

    Hi Everyone,
    I want to do a fresh install of Mavericks on my Mac Mini because it's become bloated with a bunch of work stuff and is super slow. I don't need any of the stuff in my own profile as it's now all on my MBP. When I do the restore from Time Machine I just want to restore my wife's profile and only her iTunes and iPhoto libraries - the rest can be trashed.
    Is there a way to just chose certain applications and folders to be restored? Or do I need to clean up everything first, back up and then reinstall Mavericks and restore from the new backup?
    Cheers,
    Adam

    I think so. See if this helps:
    http://pondini.org/TM/FAQ.html

  • CS6  cant open certain file extensions

    i have cs6 installed and for quite some time i havent been able to open .idml and .indd files, cs6 keeps giving me this message:  "could not complete your request because it is not the right document."?

    If you have a look here it would appear that you need to open the files with InDesign
    http://www.fileinfo.com/extension/idml
    Perhaps you need to save the files as a different format while it is in InDesign

Maybe you are looking for